# Create token

Creates a new token object for the specific account.

## Create API token

> Create API token.\
> Available for all account types (Operations account, Client account, Vendor account).\
> Accepts account reference, name, optional description, and at least one module.\
> Returns the created API token object with revision 1 and token value (returned only on create).

```json
{"openapi":"3.0.1","info":{"title":"Marketplace API","version":"5.0.5243-ga0bb7c09"},"servers":[{"url":"https://api.platform.softwareone.com"}],"paths":{"/public/v1/accounts/api-tokens":{"post":{"tags":["ApiTokens"],"summary":"Create API token","description":"Create API token.\nAvailable for all account types (Operations account, Client account, Vendor account).\nAccepts account reference, name, optional description, and at least one module.\nReturns the created API token object with revision 1 and token value (returned only on create).","requestBody":{"description":"API token payload.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateApiTokenDto"}]}},"text/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateApiTokenDto"}]}},"application/*+json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateApiTokenDto"}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToken"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"CreateApiTokenDto":{"type":"object","properties":{"account":{"allOf":[{"$ref":"#/components/schemas/AccountDto"}]},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"modules":{"type":"array","items":{"$ref":"#/components/schemas/ModuleDto"},"nullable":true},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/ExtensionDto"},"nullable":true}},"additionalProperties":false},"AccountDto":{"type":"object","properties":{"id":{"type":"string","allOf":[{"pattern":"^ACC-\\d\\d\\d\\d-\\d\\d\\d\\d$"},{"pattern":"^ACC-\\d\\d\\d\\d-\\d\\d\\d\\d$"},{"pattern":"^ACC-\\d\\d\\d\\d-\\d\\d\\d\\d$"},{"pattern":"^ACC-\\d\\d\\d\\d-\\d\\d\\d\\d$"},{"pattern":"^ACC-\\d\\d\\d\\d-\\d\\d\\d\\d$"}]}},"additionalProperties":false},"ModuleDto":{"type":"object","properties":{"id":{"type":"string","allOf":[{"pattern":"^MOD-\\d\\d\\d\\d$"},{"pattern":"^MOD-\\d\\d\\d\\d$"}]}},"additionalProperties":false},"ExtensionDto":{"type":"object","properties":{"id":{"type":"string"}},"additionalProperties":false},"ApiToken":{"type":"object","properties":{"id":{"type":"string"},"audit":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectAudit"}]},"$meta":{"allOf":[{"$ref":"#/components/schemas/PlatformMetadata"}],"nullable":true},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"status":{"type":"string"},"description":{"type":"string","nullable":true},"lastAccessAt":{"type":"string","format":"date-time","nullable":true},"token":{"type":"string"},"account":{"type":"object","allOf":[{"$ref":"#/components/schemas/AccountRef"}]},"modules":{"type":"array","items":{"$ref":"#/components/schemas/ModuleRef"}},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/PlatformObjectAuditPlatformExtension"},"nullable":true}},"additionalProperties":false},"PlatformObjectAudit":{"type":"object","properties":{"created":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"updated":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true}},"additionalProperties":false},"PlatformObjectEvent":{"type":"object","properties":{"at":{"type":"string","format":"date-time","nullable":true},"by":{"type":"object","allOf":[{"$ref":"#/components/schemas/PlatformIdentityRef"}]}},"additionalProperties":false},"PlatformIdentityRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"}},"additionalProperties":false},"PlatformMetadata":{"type":"object","properties":{"omitted":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"AccountRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"type":{"allOf":[{"$ref":"#/components/schemas/AccountType"}],"nullable":true},"status":{"allOf":[{"$ref":"#/components/schemas/AccountStatus"}],"nullable":true}},"additionalProperties":false},"AccountType":{"enum":["Client","Vendor","Operations"],"type":"string"},"AccountStatus":{"enum":["Active","Enabled","Disabled"],"type":"string"},"ModuleRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"revision":{"type":"integer","format":"int32"},"description":{"type":"string"},"filters":{"allOf":[{"$ref":"#/components/schemas/Filters"}],"nullable":true},"settings":{"allOf":[{"$ref":"#/components/schemas/ModuleSettings"}],"nullable":true}},"additionalProperties":false},"Filters":{"type":"object","properties":{"group.buyers":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"ModuleSettings":{"type":"object","properties":{"sharedAccount":{"type":"boolean","deprecated":true},"configurable":{"type":"boolean"},"default":{"type":"boolean"},"paid":{"type":"boolean"},"type":{"type":"array","items":{"type":"string"}},"obsolete":{"type":"boolean"},"eligibility":{"allOf":[{"$ref":"#/components/schemas/ModuleSettingsEligibility"}],"nullable":true}},"additionalProperties":false},"ModuleSettingsEligibility":{"type":"object","properties":{"multi":{"type":"boolean"},"single":{"type":"boolean"}},"additionalProperties":false},"PlatformObjectAuditPlatformExtension":{"type":"object","properties":{"id":{"type":"string"},"audit":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectAudit"}],"nullable":true},"$meta":{"allOf":[{"$ref":"#/components/schemas/PlatformMetadata"}],"nullable":true},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"status":{"enum":["Draft","Private","Public","Deleted"],"type":"string"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```
