curl --request PATCH \
--url https://api.example.com/tokens/{tokenId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"value": "<string>"
}
'{
"tokenId": "019525fd-f5cc-7dc1-c9e5-1f3a5b7d9e1b",
"name": "Response Token V2",
"description": "LLM response token",
"type": "RESPONSE",
"value": "0.015",
"currency": "USD",
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:30:00.000Z"
}
Atualizar nome, descricao ou configuracao de preco de um pacote de tokens.
curl --request PATCH \
--url https://api.example.com/tokens/{tokenId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"value": "<string>"
}
'{
"tokenId": "019525fd-f5cc-7dc1-c9e5-1f3a5b7d9e1b",
"name": "Response Token V2",
"description": "LLM response token",
"type": "RESPONSE",
"value": "0.015",
"currency": "USD",
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:30:00.000Z"
}
token:write.{
"tokenId": "019525fd-f5cc-7dc1-c9e5-1f3a5b7d9e1b",
"name": "Response Token V2",
"description": "LLM response token",
"type": "RESPONSE",
"value": "0.015",
"currency": "USD",
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:30:00.000Z"
}
curl -X PATCH https://api.awsales.io/admin/tokens/019525fd-f5cc-7dc1-c9e5-1f3a5b7d9e1b \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Response Token v2",
"value": "0.008"
}'
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
404 | token.not_found | Token nao encontrado |
500 | internal_server_error | Ocorreu um erro inesperado |