User
Create Personal Access Token (PAT)
API Documentation
Backend Services
- Authentication
- Email and Password
- Passwordless
- OAuth
- WebAuthn
- Anonymous
- MFA
- User
- POSTSign Out
- Storage
GraphQL
- AI
Client Libraries
- JavaScript
- React
- Next.js
- Vue
User
Create Personal Access Token (PAT)
POST
/
pat
curl --request POST \
--url https://local.auth.nhost.run/v1/pat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"expiresAt": null,
"metadata": {}
}'
{
"accessToken": "<string>",
"accessTokenExpiresIn": 123,
"refreshToken": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"user": {
"activeMfaType": "totp",
"avatarUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"defaultRole": "user",
"displayName": "John Smith",
"email": "john.smith@nhost.io",
"emailVerified": false,
"id": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"isAnonymous": false,
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"phoneNumber": "<string>",
"phoneNumberVerified": false,
"roles": [
"me",
"user"
]
}
}
Authorizations
JSON Web Token to authorize requests.
Body
application/json
The body is of type object
.
Response
200
application/json
User successfully authenticated
The response is of type object
.
curl --request POST \
--url https://local.auth.nhost.run/v1/pat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"expiresAt": null,
"metadata": {}
}'
{
"accessToken": "<string>",
"accessTokenExpiresIn": 123,
"refreshToken": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"user": {
"activeMfaType": "totp",
"avatarUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"defaultRole": "user",
"displayName": "John Smith",
"email": "john.smith@nhost.io",
"emailVerified": false,
"id": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"isAnonymous": false,
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"phoneNumber": "<string>",
"phoneNumberVerified": false,
"roles": [
"me",
"user"
]
}
}