Tokens

Create a new API token

Create a new API token with specified scopes and contractor access. Users must have manage org permissions for any contractors specified.

post/api/tokens/

Request

  • Base URL: https://api.sc-market.space
  • URL: https://api.sc-market.space/api/tokens/
  • Auth: none declared

Request body

namestring required

Name for the API token

descriptionstring

Optional description for the API token

scopesstring[] required

Array of scopes for the token. Admin scopes (admin:, admin) and moderation scopes (moderation:) are only available to admin users.

expires_atstring date-time

Optional expiration date for the token

contractor_spectrum_idsstring[]

Optional array of contractor Spectrum IDs that this token can access

Example request

{
  "name": "My API Token",
  "description": "Token for automated market operations",
  "scopes": [
    "market:read",
    "orders:write"
  ],
  "expires_at": "2024-12-31T23:59:59Z",
  "contractor_spectrum_ids": [
    "ORG-12345",
    "ORG-67890"
  ]
}

Response

Token created successfully

Example response

{
  "data": {
    "token": "scm_live_abc123..."
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.