Skip to main content

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

MethodHTTPEndpoint
createPOSTPOST /authorisation/create
updatePOSTPOST /authorisation/update
deleteDELETEDELETE /authorisation/delete/{authorisation_id}
getGETGET /authorisation/get/{authorisation_id}
listGETGET /authorisation/list
get_by_typederived
searchderived

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

FieldTypeRequiredDescription
idstringnoUnique identifier
workspaceidstringyesUnique workspace identifier (UUID v4)
namestringyesName of the resource
descriptionstringnoDetailed description of purpose and capabilities
typestringyesType 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_case keyword arguments and converts them to the camelCase wire fields shown above.

Response fields

FieldTypeDescription
idstringUnique identifier for the authorisation
namestringHuman-readable name for the authorisation
tokenSecretstringToken or secret value (encrypted)
descriptionstringDescription of the authorisation's purpose
scopestringOAuth scope or permission scope
grantTypestringOAuth grant type
clientIdstringOAuth client ID
clientSecretstringOAuth client secret (encrypted)
authorizationBaseUrlstringOAuth authorization base URL
staticArgsobjectStatic arguments (JSON object)
tokenBaseUrlstringOAuth token base URL
typestringType 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

FieldTypeRequiredDescription
idstringyesUnique identifier
workspaceidstringnoUnique workspace identifier (UUID v4)
namestringnoName of the resource
descriptionstringnoDetailed description of purpose and capabilities
typestringnoType 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_case keyword arguments and converts them to the camelCase wire 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

FieldTypeDescription
successbooleanOperation success status
dataobjectResponse data
messagestringOptional 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 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="…")