Skip to content

Auth API (v2)

Download OpenAPI description
Languages
Servers
Sandbox URL
https://api-ext-sboxmeta.partners.spotnana.com
Spotnana mock server
https://developer.spotnana.com/_mock/openapi/authapi

Authentication

Authentication APIs for user login, logout, and token management

Operations

API User

Operations

Create a new API user

Request

Creates a new API user (also known as a machine user) that your application can use to authenticate with Spotnana APIs.

Use this endpoint to:

  • Generate a dedicated clientId and clientSecret pair that your backend services can use to obtain access tokens.
  • Create a SCIM API user by setting credentialType to SCIM_TOKEN with role set to COMPANY_ADMIN. This returns a SCIM bearer token instead of a client secret.

Role assignment:

  • With role: The API user is automatically added to the corresponding RBAC user group (TMC Admin or Company Admin) based on the specified role. Requires tmcId for TMC admin, or both orgId and tmcId for company admin.

  • Without role: The API user is created without any RBAC roles. Requires orgId. Use this option for granular permission control — assign specific RBAC groups or roles to the returned userId via the RBAC assignment endpoints.

Credential types:

  • CLIENT_CREDENTIALS (default): Returns a clientId and clientSecret. Use them in POST /v2/auth/oauth2-token to obtain an access token.
  • SCIM_TOKEN: Returns a SCIM bearer token instead of a client secret. Requires role set to COMPANY_ADMIN.

Next steps:

  • For CLIENT_CREDENTIALS (default): Use the clientId and clientSecret in the POST /v2/auth/oauth2-token endpoint to obtain an access token.
  • For SCIM_TOKEN: Use the returned scimToken as the Bearer token in the Authorization header for SCIM API requests (/v2/scim/Users, etc.).
  • If created without role: Use the returned userId with POST /v3/user-groups/{userGroupId}/members to add the user to RBAC groups, or POST /v3/users/{userId}/roles to assign roles directly.

Notes:

  • Store the clientSecret or scimToken securely. They are only returned once at creation and cannot be retrieved later.
  • There is a fixed limit on the number of API users per TMC. To increase this limit, contact your Spotnana representative.
Bodyapplication/jsonrequired
tmcIdstring

TMC ID. Required when role is TMC_ADMIN.

Example: "ecc5b835-8001-430c-98f8-fedeccebe4cf"
orgIdstring

Organization (company) ID. Required when role is omitted or COMPANY_ADMIN.

Example: "ecc5b835-8001-430c-98f8-fedeccebe4cf"
namestring

Display name for the API user.

Default "Api User"
Example: "My Integration Bot"
rolestring(ApiUserRoleEnum)

Roles supported for api user creation

Enum"TMC_ADMIN""COMPANY_ADMIN"
credentialTypestring(ApiUserCredentialTypeEnum)

Type of credentials to generate for the API user. Defaults to CLIENT_CREDENTIALS.

Enum"CLIENT_CREDENTIALS""SCIM_TOKEN"
curl -i -X POST \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/api-users \
  -H 'Content-Type: application/json' \
  -d '{
    "tmcId": "ecc5b835-8001-430c-98f8-fedeccebe4cf",
    "orgId": "ecc5b835-8001-430c-98f8-fedeccebe4cf",
    "name": "My Integration Bot",
    "role": "TMC_ADMIN",
    "credentialType": "CLIENT_CREDENTIALS"
  }'

Responses

User created successfully

Bodyapplication/json
clientIdstring

Api user client id

Example: "1ddj3hs95to28iag7m4hl9lv2"
clientSecretstring

Api user client secret. Present for CLIENT_CREDENTIALS credential type.

Example: "1hgea74sii6os6vlkk1c7krlfgniaphbn2c56pml"
userIdstring(uuid)

User ID of the created API user

Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
scimTokenstring

SCIM bearer token (Base64-encoded JSON envelope with encrypted secret). Present only for SCIM_TOKEN credential type.

Example: "eyJzY29wZSI6InNjaW0iLCJjbGllbnRJZCI6Ii4uLiIsImVuY3J5cHRlZFNlY3JldCI6Ii4uLiJ9"
Response
application/json
{ "clientId": "1ddj3hs95to28iag7m4hl9lv2", "clientSecret": "1hgea74sii6os6vlkk1c7krlfgniaphbn2c56pml", "userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "scimToken": "eyJzY29wZSI6InNjaW0iLCJjbGllbnRJZCI6Ii4uLiIsImVuY3J5cHRlZFNlY3JldCI6Ii4uLiJ9" }

Get API users for a TMC

Request

Retrieves the list of all active API users associated with the caller's TMC.

Use this endpoint to:

  • Audit existing API users and their clientIds under a TMC.
  • Look up the clientId for a specific API user before rotating its client secret or revoking access.

Notes:

  • This endpoint supports pagination using limit and offset query parameters.
  • The response includes only the clientId for each user. The clientSecret is never returned.
  • Returns only the API users belonging to the caller's contracting TMC.
  • Only a TMC admin can use this endpoint.
Query
limitinteger[ 0 .. 100 ]

Number of results to return

Default 100
offsetinteger>= 0

Offset for pagination

Default 0
curl -i -X GET \
  'https://api-ext-sboxmeta.partners.spotnana.com/v2/api-users?limit=100&offset=0'

Responses

OK

Bodyapplication/json
apiUsersArray of objects(ApiUsersInfo)

List of api users

totalCountinteger

Total count of api users

Example: 25
Response
application/json
{ "apiUsers": [ {} ], "totalCount": 25 }

Delete an API user

Request

Permanently deletes an API user and revokes its access to the Spotnana platform. This immediately invalidates all existing access tokens and removes the API user's ability to authenticate.

Use this endpoint to:

  • Revoke access for an API user that is no longer needed.
  • Decommission an integration or clean up unused API users.
  • Free up a slot in your TMC's API user quota (default up to 5 API users per TMC).

Best practice:

Before revoking, ensure no active integrations are using this clientId. Be sure to:

  1. create a new API user first
  2. update your integrations to use the new credentials
  3. verify they work
  4. and then revoke the old API user.

Notes:

  • This action is permanent and cannot be undone. The clientId and clientSecret are permanently invalidated.
  • All active tokens for this API user are invalidated immediately. Any in-flight API requests using those tokens will fail.
  • The API user being revoked must belong to the same TMC as the caller.
  • Only a TMC admin can use this endpoint.
Bodyapplication/jsonrequired
clientIdstring

Api user client id

curl -i -X POST \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/api-users/revoke \
  -H 'Content-Type: application/json' \
  -d '{
    "clientId": "string"
  }'

Responses

No Content

Response
No content

Rotate client secret for an API user

Request

Generates a new clientSecret for an existing API user. The old clientSecret is immediately invalidated and all existing access tokens for the API user will be expired.

Use this endpoint to:

  • Rotate credentials as part of a regular security hygiene practice.
  • Replace a clientSecret without deleting the API user.
  • Generate a new clientSecret if the old secret was lost or not stored.

Best practice:

  • Update your integrations with the new clientSecret immediately after rotation. Any authentication requests using the old secret will fail.

Notes:

  • The new clientSecret is only returned once in the response and cannot be retrieved later. Store it securely.
  • The clientId remains the same.
  • The old clientSecret stops working immediately. Any integration using it will need to re-authenticate with the new secret.
  • All existing access tokens created using the old clientSecret are immediately invalidated.
  • Only a TMC admin can use this endpoint.
Bodyapplication/jsonrequired
clientIdstring

Api user client id

curl -i -X POST \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/api-users/rotate \
  -H 'Content-Type: application/json' \
  -d '{
    "clientId": "string"
  }'

Responses

Client secret generated successfully

Bodyapplication/json
clientIdstring

Api user client id

Example: "1ddj3hs95to28iag7m4hl9lv2"
clientSecretstring

Api user client secret

Example: "1hgea74sii6os6vlkk1c7krlfgniaphbn2c56pml"
Response
application/json
{ "clientId": "1ddj3hs95to28iag7m4hl9lv2", "clientSecret": "1hgea74sii6os6vlkk1c7krlfgniaphbn2c56pml" }