DevZero Logo
DevZero

Create personal access token for user

POST
/users/{user_id}/pat
/users/{user_id}/pat

Request Body

application/jsonRequired

create pat for user body

expiry
Required
integer

number of days this pat shall be valid for

Minimum: 0Maximum: 36500

name
Required
string

Name of Token

Minimum length: 1

Path Parameters

user_id
Required
string

ID of user

Header Parameters

Authorization
Required
string

sub claim pulled from JWT

curl -X POST "https://api.devzero.io/backend/v0/users/string/pat" \
  -H "Authorization: string" \
  -H "Content-Type: application/json" \
  -d '{
    "expiry": 36500,
    "name": "string"
  }'

OK

{
  "content": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "expiry": "2019-08-24T14:15:22Z",
  "id": "string",
  "lasted_used": "2019-08-24T14:15:22Z",
  "name": "string"
}