Skip to main content
PUT
/
api
/
v1
/
services
Python (SDK)
import os
from syllable_sdk import SyllableSDK, models


with SyllableSDK(
    api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:

    res = ss_client.services.update(request={
        "name": "Weather tools",
        "description": "Service containing tools for fetching weather information",
        "auth_type": models.ToolAuthType.BASIC,
        "auth_values": {
            "password": "my-password",
            "username": "my-username",
        },
        "id": 1,
        "last_updated_comments": "Updated description to correct typo",
    })

    # Handle response
    print(res)
{
  "id": 123,
  "name": "<string>",
  "description": "<string>",
  "last_updated": "2023-11-07T05:31:56Z",
  "last_updated_by": "<string>",
  "tools": [
    "<string>"
  ],
  "auth_type": "basic",
  "auth_value_keys": [
    "username",
    "password"
  ],
  "last_updated_comments": "Updated description to correct typo"
}

Authorizations

Syllable-API-Key
string
header
required

Body

application/json

Request model to update an existing service.

name
string
required

The name of the service

description
string
required

The description of the service

id
integer
required

The internal ID of the service

auth_type
enum<string> | null

The type of authentication to use for the service's tools

Available options:
basic,
bearer,
custom_headers,
oauth2
Example:

"basic"

auth_values
any | null

The values to use for the authentication, as a dict. Should contain "username" and "password" keys if auth type is basic, "token" key if auth type is bearer, arbitrary header keys if auth type is custom_headers. or "client_id", "client_secret", and "auth_url" keys if auth type is oauth2. On an update, leave a value for a given key null and the value in the database will not be updated. (If a key is omitted entirely, any existing value for that key will be removed.)

Example:
{
"password": "my-password",
"username": "my-username"
}
last_updated_comments
string | null

Free text providing comment about what was updated

Example:

"Updated description to correct typo"

Response

Successful Response

Response model for service operations. A service is a collection of tools.

id
integer
required

The internal ID of the service

name
string
required

The name of the service

description
string
required

The description of the service

last_updated
string<date-time>
required

The timestamp of the most recent update to the service

last_updated_by
string
required

The email of the user who last updated the service

tools
string[]
required

Names of tools that belong to the service

auth_type
enum<string> | null

The type of authentication to use for the service's tools

Available options:
basic,
bearer,
custom_headers,
oauth2
Example:

"basic"

auth_value_keys
string[] | null

Auth value keys (values omitted for security)

Example:
["username", "password"]
last_updated_comments
string | null

Free text providing comment about what was updated

Example:

"Updated description to correct typo"