curl --request POST \
--url https://qwoty.app/api/tokens \
--header 'Content-Type: application/json' \
--data '{
"name": "Production API Token",
"expires_at": "2025-12-31T23:59:59Z"
}'
const response = await fetch('https://qwoty.app/api/tokens', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Production API Token',
expires_at: '2025-12-31T23:59:59Z',
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/tokens',
json={
'name': 'Production API Token',
'expires_at': '2025-12-31T23:59:59Z'
}
)
data = response.json()
{
"success": true,
"data": {
"id": "tok_123abc",
"name": "Production API Token",
"token": "qwoty_live_abc123def456...",
"expires_at": "2025-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z"
}
}
{
"error": "Invalid request data",
"details": {
"name": ["Required field"]
}
}
Tokens
Create API Token
Create a new API token for authentication
POST
/
api
/
tokens
curl --request POST \
--url https://qwoty.app/api/tokens \
--header 'Content-Type: application/json' \
--data '{
"name": "Production API Token",
"expires_at": "2025-12-31T23:59:59Z"
}'
const response = await fetch('https://qwoty.app/api/tokens', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Production API Token',
expires_at: '2025-12-31T23:59:59Z',
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/tokens',
json={
'name': 'Production API Token',
'expires_at': '2025-12-31T23:59:59Z'
}
)
data = response.json()
{
"success": true,
"data": {
"id": "tok_123abc",
"name": "Production API Token",
"token": "qwoty_live_abc123def456...",
"expires_at": "2025-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z"
}
}
{
"error": "Invalid request data",
"details": {
"name": ["Required field"]
}
}
Authorization
string
required
Bearer token for authentication. Format:
Bearer qwoty_your_tokenRequest Body
string
required
A descriptive name for the API token
string
Optional expiration date in ISO 8601 format (e.g., “2024-12-31T23:59:59Z”)
object
Optional permissions configuration for the token
Permissions of write endpoints
A token acts with the permissions of its role. Read endpoints (GET) only need a valid token. Write endpoints check the role and answer 403 when the permission is missing:
| Endpoints | Required permission |
|---|---|
POST / PATCH on /catalogs, /categories, /prices, /products, /product-parents, /payment-terms | product_pricing:write |
DELETE /categories/{id} | product_pricing:delete |
POST / PATCH on /customers, /contacts, /addresses | customer:write |
403 Forbidden
{ "error": "Insufficient permissions. Requires product_pricing:write" }
Response
boolean
Indicates if the operation was successful
object
curl --request POST \
--url https://qwoty.app/api/tokens \
--header 'Content-Type: application/json' \
--data '{
"name": "Production API Token",
"expires_at": "2025-12-31T23:59:59Z"
}'
const response = await fetch('https://qwoty.app/api/tokens', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Production API Token',
expires_at: '2025-12-31T23:59:59Z',
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/tokens',
json={
'name': 'Production API Token',
'expires_at': '2025-12-31T23:59:59Z'
}
)
data = response.json()
{
"success": true,
"data": {
"id": "tok_123abc",
"name": "Production API Token",
"token": "qwoty_live_abc123def456...",
"expires_at": "2025-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z"
}
}
{
"error": "Invalid request data",
"details": {
"name": ["Required field"]
}
}
Last modified on October 28, 2026
Was this page helpful?

