POSThttps://api.spotinst.io/setup/user/programmatic

This API creates a new programmatic user (not a human user). Use this API to provide privileges to an application that needs to interface with  Spot. Spot returns a token that the programmatic user can use to perform actions with.

Request - Create Programmatic User

Headers
Copied!
Downloaded!
{
    "Authorization": "Bearer ${token}",
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "name": "testProgrammaticApi",
    "description": "test programmatic",
    "accounts": [
        {"id":"act-123",
         "role": "editor"},
        {"id":"act-1234",
         "role": "viewer"}
    ]
}

Body Attributes


Attribute Type Description
name * String

Name of the programmatic user.

Example: testProgrammaticApi
description String

Brief description of the user.

accounts * Array<Object>

All the accounts the programmatic user will have access to. Cannot be empty.

accounts.id * String

Account ID the programmatic user will have access to.

Example: act-123
accounts.role * String

Role to be associated with the programmatic user for this account. Valid values are "editor" and "viewer".

Example: viewer
Response - 200

Headers
Copied!
Downloaded!
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
"response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:setup:programmaticUser",
    "items": [
      {
        "token":"f872e7b157866a36229d915aa21cf430f66123456803fd",
        "name": "TestApi1"
      }
    ],
    "count": 1
  }