Authorisations
Authorisations
toothfairyai@latest…Manager for authorisations operations.
This manager provides methods to create, update, and manage authorisations.
Example:
>>> client = ToothFairyClient(api_key="...", workspace_id="...")
>>> authorisation = client.authorisations.create(...)
Accessed via client.authorisations.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
create | POST | POST /authorisation/create |
update | POST | POST /authorisation/update |
delete | DELETE | DELETE /authorisation/delete/{authorisation_id} |
get | GET | GET /authorisation/get/{authorisation_id} |
list | GET | GET /authorisation/list |
get_by_type | — | derived |
search | — | derived |
create
Create a new authorisation.
def create(
name: str,
auth_type: str,
token_secret: Optional[str] = None,
description: Optional[str] = None,
scope: Optional[str] = None,
grant_type: Optional[str] = None,
client_id: Optional[str] = None,
client_secret: Optional[str] = None,
authorization_base_url: Optional[str] = None,
static_args: Optional[str] = None,
token_base_url: Optional[str] = None
) -> Authorisation
Endpoint: POST /authorisation/create · API service
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | no | Unique identifier |
workspaceid | string | yes | Unique workspace identifier (UUID v4) |
name | string | yes | Name of the resource |
description | string | no | Detailed description of purpose and capabilities |
type | string | yes | Type classification (free-form string identifier) |
Allowed: apikey, bearer, oauth, password, env, username_and_password, generic, none, basic |
| createdBy | string | no | ID of the user who created this resource |
| updatedBy | string | no | ID of the user who last updated this resource |
| clientId | string | no | OAuth client ID |
| clientSecret | string | no | OAuth client secret |
| tokenSecret | string | no | Secret reference ID for the token/credential |
| authorizationBaseUrl | string | no | OAuth authorization base URL |
| grantType | string | no | OAuth grant type |
| scope | string | no | OAuth scope |
| staticArgs | string | no | JSON-encoded static arguments for the authorisation |
| tokenBaseUrl | string | no | OAuth token base URL |
| desk_username | string | no | Username for username_and_password authorisation |
| desk_password | string | no | Password for username_and_password authorisation |
The Python SDK accepts
snake_casekeyword arguments and converts them to thecamelCasewire fields shown above.
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the authorisation |
name | string | Human-readable name for the authorisation |
tokenSecret | string | Token or secret value (encrypted) |
description | string | Description of the authorisation's purpose |
scope | string | OAuth scope or permission scope |
grantType | string | OAuth grant type |
clientId | string | OAuth client ID |
clientSecret | string | OAuth client secret (encrypted) |
authorizationBaseUrl | string | OAuth authorization base URL |
staticArgs | object | Static arguments (JSON object) |
tokenBaseUrl | string | OAuth token base URL |
type | string | Type of authorisation |
Allowed: bearer, apikey, oauth, password, env, generic, none, username_and_password, basic |
| workspaceID | string | Unique workspace identifier (UUID v4) |
| createdBy | string | User who created the authorisation |
| updatedBy | string | User who last updated the authorisation |
| createdAt | string | Timestamp when this resource was created |
| updatedAt | string | Timestamp when this resource was last updated |
Example
client.authorisations.create(name="…", auth_type="…")
update
Update a authorisation.
def update(authorisation_id: str) -> Authorisation
Endpoint: POST /authorisation/update · API service
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique identifier |
workspaceid | string | no | Unique workspace identifier (UUID v4) |
name | string | no | Name of the resource |
description | string | no | Detailed description of purpose and capabilities |
type | string | no | Type classification (free-form string identifier) |
Allowed: apikey, bearer, oauth, password, env, username_and_password, generic, none, basic |
| createdBy | string | no | ID of the user who created this resource |
| updatedBy | string | no | ID of the user who last updated this resource |
| clientId | string | no | OAuth client ID |
| clientSecret | string | no | OAuth client secret |
| tokenSecret | string | no | Secret reference ID for the token/credential |
| authorizationBaseUrl | string | no | OAuth authorization base URL |
| grantType | string | no | OAuth grant type |
| scope | string | no | OAuth scope |
| staticArgs | string | no | JSON-encoded static arguments for the authorisation |
| tokenBaseUrl | string | no | OAuth token base URL |
| desk_username | string | no | Username for username_and_password authorisation |
| desk_password | string | no | Password for username_and_password authorisation |
The Python SDK accepts
snake_casekeyword arguments and converts them to thecamelCasewire fields shown above.
Response
Returns the Authorisation object — fields documented in the create section above.
Example
client.authorisations.update(authorisation_id="agent-id")
delete
Delete a authorisation.
def delete(authorisation_id: str) -> Dict[str, bool]
Endpoint: DELETE /authorisation/delete/{authorisation_id} · API service
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Operation success status |
data | object | Response data |
message | string | Optional success message |
Example
client.authorisations.delete(authorisation_id="agent-id")
get
Get a authorisation by ID.
def get(authorisation_id: str) -> Authorisation
Endpoint: GET /authorisation/get/{authorisation_id} · API service
Response
Returns the Authorisation object — fields documented in the create section above.
Example
client.authorisations.get(authorisation_id="agent-id")
list
List all authorisations.
def list(
limit: Optional[int] = None,
offset: Optional[int] = None
) -> ListResponse
Endpoint: GET /authorisation/list · API service
Example
client.authorisations.list()
get_by_type
Get authorisations by type.
def get_by_type(auth_type: str) -> List[Authorisation]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.authorisations.get_by_type(auth_type="…")
search
Search authorisations by name.
def search(search_term: str) -> List[Authorisation]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.authorisations.search(search_term="…")