{"openapi":"3.1.0","info":{"title":"POST /api/v1/tokens/{token_id}/revoke","version":"1.0.0","description":"Revoke token"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/tokens/{token_id}/revoke":{"post":{"tags":["api-tokens"],"summary":"Revoke token","description":"Revoke an API token.\n\n**Path Parameters:**\n- `token_id`: UUID of the token to revoke\n\n**Request Body:** (optional)\n- `reason`: Optional reason for revocation\n\n**Note:** Once revoked, the token can no longer be used for authentication.\nThe token is added to a blacklist and will be rejected on all future requests.\n\nRevoked tokens cannot be un-revoked.\n\n**Returns:** Revoked token information with revocation timestamp.","operationId":"revoke_token_api_v1_tokens__token_id__revoke_post","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","title":"Token Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/APITokenRevokeRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_APITokenRevokeResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"APITokenRevokeRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional reason for revocation"}},"type":"object","title":"APITokenRevokeRequest","description":"Request schema for revoking a token."},"APITokenRevokeResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Token record ID"},"jti":{"type":"string","title":"Jti","description":"JWT ID of the revoked token"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Token name"},"revoked_at":{"type":"string","format":"date-time","title":"Revoked At","description":"When the token was revoked"},"revoked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked By","description":"Email of the user who revoked the token"},"revocation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Reason","description":"Reason for revocation"}},"type":"object","required":["id","jti","revoked_at"],"title":"APITokenRevokeResponse","description":"Response schema for token revocation."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_APITokenRevokeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/APITokenRevokeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[APITokenRevokeResponse]"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}