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_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​

Python kwargWire fieldTypeRequiredDescription
ididstringnoUnique identifier
workspace_idworkspaceidstringyesUnique workspace identifier (UUID v4)
namenamestringyesName of the resource
descriptiondescriptionstringnoDetailed description of purpose and capabilities
typetypestringyesType classification (free-form string identifier)

Allowed: apikey, bearer, oauth, password, env, username_and_password, generic, none, basic | | created_by | createdBy | string | no | ID of the user who created this resource | | updated_by | updatedBy | string | no | ID of the user who last updated this resource | | client_id | clientId | string | no | OAuth client ID | | client_secret | clientSecret | string | no | OAuth client secret | | token_secret | tokenSecret | string | no | Secret reference ID for the token/credential | | authorization_base_url | authorizationBaseUrl | string | no | OAuth authorization base URL | | grant_type | grantType | string | no | OAuth grant type | | scope | scope | string | no | OAuth scope | | static_args | staticArgs | string | no | JSON-encoded static arguments for the authorisation | | token_base_url | tokenBaseUrl | string | no | OAuth token base URL | | desk_username | desk_username | string | no | Username for username_and_password authorisation | | desk_password | desk_password | string | no | Password for username_and_password authorisation |

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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​

Python kwargWire fieldTypeRequiredDescription
ididstringyesUnique identifier
workspace_idworkspaceidstringnoUnique workspace identifier (UUID v4)
namenamestringnoName of the resource
descriptiondescriptionstringnoDetailed description of purpose and capabilities
typetypestringnoType classification (free-form string identifier)

Allowed: apikey, bearer, oauth, password, env, username_and_password, generic, none, basic | | created_by | createdBy | string | no | ID of the user who created this resource | | updated_by | updatedBy | string | no | ID of the user who last updated this resource | | client_id | clientId | string | no | OAuth client ID | | client_secret | clientSecret | string | no | OAuth client secret | | token_secret | tokenSecret | string | no | Secret reference ID for the token/credential | | authorization_base_url | authorizationBaseUrl | string | no | OAuth authorization base URL | | grant_type | grantType | string | no | OAuth grant type | | scope | scope | string | no | OAuth scope | | static_args | staticArgs | string | no | JSON-encoded static arguments for the authorisation | | token_base_url | tokenBaseUrl | string | no | OAuth token base URL | | desk_username | desk_username | string | no | Username for username_and_password authorisation | | desk_password | desk_password | string | no | Password for username_and_password authorisation |

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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="…")