Mint a token for a person
This endpoint creates a token for a specific user.
Custom claims can be specified in the request body which will be added to the token's payload. Custom claims are added to the token's payload.
Tokens created with this endpoint will have an authenticated_methods claim equal to ["api"].
The following claims are reserved and cannot be specified:
- aud
- exp
- jti
- iat
- iss
- nbf
- sub
- prev_token_id
- oid
- org_id
- user_id
- person_id
- first_token
- authenticated_methods
- oidc_tokens
- user_token
- groups
- roles
- access_token
- refresh_token
- id
- id_token
- gdpr
- gdpr_consent
- gdpr_consent_level
- parent_user_id
- parent_person_id
- parent_org_id
- parent_oid
- attributes
- custom_claims
- slashid
- slashid.dev
- slashid.com
- slashid.me
- sid
With the following request body:
{
"custom_claims": {
"foo": "bar",
"baz": {"everything": 42}
}
}
the token in the response will have the following payload:
{
"authenticated_methods": [
"api"
],
"baz": {
"everything": 42
},
"exp": <expiration time timestamp>,
"first_token": false,
"foo": "bar",
"iat": <issued at timestamp>,
"iss": <token issuer>,
"jti": <token ID>,
"oid": <organisation ID>,
"person_id": <person ID>
}
Path Parameters
- person_id string required
The person ID
Example: 903c1ff9-f2cc-435c-b242-9d8a690fcf0a
Header Parameters
- SlashID-OrgID string required
The organization ID
Example: af5fbd30-7ce7-4548-8b30-4cd59cb2aba1
- application/json
Request Body required
custom_claims object
Set of custom claims to be added to the JWT payload, as key-value pairs.
- 201
- 401
- 404
The result string is a newly-minted SlashID token.
- application/json
- Schema
- Example (from schema)
Schema
meta object
pagination object
limit integeroffset integertotal_count int64cursor_pagination object
Cursors are opaque. Follow the tokens the server returns; never construct, parse or modify one.
limit integernext_cursor stringOpaque token addressing the next page. Absent on the last page.
prev_cursor stringOpaque token addressing the previous page. Absent on the first page.
last_cursor stringOpaque token addressing the final page directly, so a client can jump to the end without a total count.
total_count int64Total number of matching items. Returned on the FIRST page only; clients cache it for the remainder of the walk.
errors object[]
httpcode integermessage string- result string
{
"meta": {
"pagination": {
"limit": 0,
"offset": 0,
"total_count": 0
},
"cursor_pagination": {
"limit": 0,
"next_cursor": "string",
"prev_cursor": "string",
"last_cursor": "string",
"total_count": 0
}
},
"errors": [
{
"httpcode": 0,
"message": "string"
}
],
"result": "string"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
meta object
pagination object
limit integeroffset integertotal_count int64cursor_pagination object
Cursors are opaque. Follow the tokens the server returns; never construct, parse or modify one.
limit integernext_cursor stringOpaque token addressing the next page. Absent on the last page.
prev_cursor stringOpaque token addressing the previous page. Absent on the first page.
last_cursor stringOpaque token addressing the final page directly, so a client can jump to the end without a total count.
total_count int64Total number of matching items. Returned on the FIRST page only; clients cache it for the remainder of the walk.
errors object[]
httpcode integermessage string
{
"meta": {
"pagination": {
"limit": 0,
"offset": 0,
"total_count": 0
},
"cursor_pagination": {
"limit": 0,
"next_cursor": "string",
"prev_cursor": "string",
"last_cursor": "string",
"total_count": 0
}
},
"errors": [
{
"httpcode": 0,
"message": "string"
}
]
}
Not Found
- application/json
- Schema
- Example (from schema)
Schema
meta object
pagination object
limit integeroffset integertotal_count int64cursor_pagination object
Cursors are opaque. Follow the tokens the server returns; never construct, parse or modify one.
limit integernext_cursor stringOpaque token addressing the next page. Absent on the last page.
prev_cursor stringOpaque token addressing the previous page. Absent on the first page.
last_cursor stringOpaque token addressing the final page directly, so a client can jump to the end without a total count.
total_count int64Total number of matching items. Returned on the FIRST page only; clients cache it for the remainder of the walk.
errors object[]
httpcode integermessage string
{
"meta": {
"pagination": {
"limit": 0,
"offset": 0,
"total_count": 0
},
"cursor_pagination": {
"limit": 0,
"next_cursor": "string",
"prev_cursor": "string",
"last_cursor": "string",
"total_count": 0
}
},
"errors": [
{
"httpcode": 0,
"message": "string"
}
]
}