Skip to main content

Team management API

This page documents the 36 gateway endpoints tagged team management in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/team/daily/activity/aggregatedDaily activity per team
GET/team/daily/activity/aggregated/keysKeys ranked by spend for a team
GET/team/daily/activity/aggregated/searchSearch the keys with activity for a team
GET/team/daily/activity/aggregated/model_top_keysTop keys for one model in a team
GET/team/daily/activity/exportDownload team daily activity as CSV or JSON
POST/team/newCreate a team
POST/team/updateUpdate a team
PATCH/team/{team_id}Update a team by id
POST/team/member_addAdd members to a team
POST/team/member_deleteRemove a member from a team
POST/team/member_updateChange a member's role or budget in a team
POST/team/{team_id}/member/{user_id}/reset_spendReset a member's spend in a team
POST/team/{team_id}/member/{user_id}/reset_budgetReset a member's budget to the team default
POST/team/bulk_member_addAdd many members to a team at once
POST/team/deleteDelete teams
GET/team/infoGet a team with its keys and members
GET/team/{team_id}/members/meYour own membership in a team
POST/team/blockBlock a team
POST/team/unblockUnblock a team
GET/team/metadata_schemaFields allowed in team metadata
GET/team/availableTeams the caller may join
GET/v2/team/listList teams with paging and filters
GET/team/listList teams
POST/team/model/addAdd models to a team
POST/team/model/deleteRemove models from a team
GET/team/permissions_listWhat members of a team may do with keys
POST/team/permissions_updateSet what members of a team may do with keys
POST/team/permissions_bulk_updateAdd member permissions to many teams
GET/team/daily/activityDaily spend and usage of a team
GET/team/spend/by_userSpend per member of a team
POST/management/v1/teams/{team_id}/members/bulk_deleteRemove many members from a team at once
POST/management/v1/teams/{team_id}/members/bulk_updateChange many members' budgets in a team at once
GET/team/{team_id}/callbackLogging callbacks of a team
POST/team/{team_id}/callbackAdd a logging callback to a team
DELETE/team/{team_id}/callback/{callback_name}Remove a logging callback from a team
POST/team/{team_id}/disable_loggingTurn off logging callbacks for a team

Endpoints​

GET /team/daily/activity/aggregated​

Daily activity per team

Spend, tokens and requests per day for the teams you can see, with a breakdown per team, in one answer with nothing to page. Filter with team_ids or exclude_team_ids (comma separated), start_date and end_date (YYYY-MM-DD), model and api_key. timezone is the offset in minutes from UTC, the way a browser reports it with Date.getTimezoneOffset().

Parameters:

NameInTypeRequiredDescription
api_key_limitqueryintegerNoHow many top keys to return
team_idsquerystring or nullNo
start_datequerystring or nullNo
end_datequerystring or nullNo
modelquerystring or nullNo
api_keyquerystring or nullNo
exclude_team_idsquerystring or nullNo
timezonequeryinteger or nullNo

Example request:

curl -X GET "http://localhost:4000/team/daily/activity/aggregated" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json SpendAnalyticsPaginatedResponse
400The date range is invalidapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller may not read this scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The analytics query failed, the gateway log has the causeapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
resultsarray of DailySpendDataYesResults
metadataDailySpendMetadataNo

GET /team/daily/activity/aggregated/keys​

Keys ranked by spend for a team

One page of the virtual keys that spent the most inside the team scope and date range, with the spend, tokens and request counts of each. offset and limit page through the list and total_api_keys says how many keys there are in all. Docs (https://docs.spanway.ai/docs/proxy/spend_logs_export)

Parameters:

NameInTypeRequiredDescription
offsetqueryintegerNoHow many rows to skip, for paging
limitqueryintegerNoHow many rows to return
team_idsquerystring or nullNo
start_datequerystring or nullNo
end_datequerystring or nullNo
modelquerystring or nullNo
api_keyquerystring or nullNo
exclude_team_idsquerystring or nullNo
timezonequeryinteger or nullNo

Example request:

curl -X GET "http://localhost:4000/team/daily/activity/aggregated/keys" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json DailyActivityKeyPageResponse
400The date range is invalidapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller may not read this scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The analytics query failed, the gateway log has the causeapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
api_keysarray of KeySpendActivityRowYesApi Keys
total_api_keysintegerYesTotal Api Keys
offsetintegerYesOffset
limitintegerYesLimit

Search the keys with activity for a team

Find virtual keys with activity inside the team scope and date range whose alias, hash, user id or email matches the search text, each with its spend, tokens and request counts. This is the key search box of the Usage page. Docs (https://docs.spanway.ai/docs/proxy/spend_logs_export)

Parameters:

NameInTypeRequiredDescription
searchquerystringYesText to find in key aliases and key hashes
limitqueryintegerNoHow many rows to return
team_idsquerystring or nullNo
start_datequerystring or nullNo
end_datequerystring or nullNo
modelquerystring or nullNo
api_keyquerystring or nullNo
exclude_team_idsquerystring or nullNo
timezonequeryinteger or nullNo

Example request:

curl -X GET "http://localhost:4000/team/daily/activity/aggregated/search?search=string" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json DailyActivityKeySearchResponse
400The date range is invalidapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller may not read this scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The analytics query failed, the gateway log has the causeapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
api_keysarray of KeyActivityRowYesApi Keys

GET /team/daily/activity/aggregated/model_top_keys​

Top keys for one model in a team

The virtual keys that spent the most on one model inside the team scope and date range. by_model_group tells whether model was matched as the public model group or as the individual deployment. Docs (https://docs.spanway.ai/docs/proxy/spend_logs_export)

Parameters:

NameInTypeRequiredDescription
model_groupquerystringYesThe model or model group to rank keys for
by_model_groupquerybooleanNoMatch model_group as a model group, not a model
limitqueryintegerNoHow many rows to return
team_idsquerystring or nullNo
start_datequerystring or nullNo
end_datequerystring or nullNo
modelquerystring or nullNo
api_keyquerystring or nullNo
exclude_team_idsquerystring or nullNo
timezonequeryinteger or nullNo

Example request:

curl -X GET "http://localhost:4000/team/daily/activity/aggregated/model_top_keys?model_group=claude-sonnet-5-5" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json ModelTopKeysResponse
400The date range is invalidapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller may not read this scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The analytics query failed, the gateway log has the causeapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
modelstringYesModel
by_model_groupbooleanYesBy Model Group
api_keysarray of KeySpendActivityRowYesApi Keys

GET /team/daily/activity/export​

Download team daily activity as CSV or JSON

Stream one row per day for each team in the range, with requests, tokens and spend. export_type picks the breakdown: daily, daily_with_keys, daily_with_models or daily_with_users. format is csv (the default) or json. The file name carries the entity, the range and the breakdown. This is the Export Data dialog of the Usage page. Docs (https://docs.spanway.ai/docs/proxy/spend_logs_export)

Parameters:

NameInTypeRequiredDescription
export_typequeryExportTypeNoThe breakdown of each row
formatqueryenum: "csv", "json"Nocsv or json
team_idsquerystring or nullNo
start_datequerystring or nullNo
end_datequerystring or nullNo
modelquerystring or nullNo
api_keyquerystring or nullNo
exclude_team_idsquerystring or nullNo
timezonequeryinteger or nullNo

Example request:

curl -X GET "http://localhost:4000/team/daily/activity/export" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Streamed daily activity exporttext/csv string
400Bad Requestapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller may not read this scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The analytics query failed, the gateway log has the causeapplication/json ErrorDetail

POST /team/new​

Create a team

Allow users to create a new team. Apply user permissions to their team.

How team budgets work

What to send:

  • team_alias: User defined team alias
  • team_id: The team id of the user. If none passed, we'll generate it.
  • members_with_roles: A list of users and their roles in the team. Get user_id when making a new user via /user/new.
  • team_member_permissions: A list of routes that non-admin team members can access. example: ["/key/generate", "/key/update", "/key/delete"]
  • metadata: Metadata for team, store information for team. Example metadata = {"extra_info": "some info"}
  • model_rpm_limit: The RPM (Requests Per Minute) limit for this team - applied across all keys for this team.
  • model_tpm_limit: The TPM (Tokens Per Minute) limit for this team - applied across all keys for this team.
  • default_estimated_output_tokens: Expected output tokens reserved for TPM limiting when a request omits max_tokens, for keys on this team that do not set their own. Positive integer.
  • default_estimated_output_tokens_per_model: Per-model override of the above. Example: {"gpt-4": 4096, "gpt-3.5-turbo": 1024}
  • mcp_rpm_limit: Per-MCP-server RPM limit for this team, keyed by MCP server name (alias if set, else the configured name). Example: {"jira": 100, "slack": 200}. Applied across all keys for this team.
  • tpm_limit: The TPM (Tokens Per Minute) limit for this team - all keys with this team_id will have at max this TPM limit
  • rpm_limit: The RPM (Requests Per Minute) limit for this team - all keys associated with this team_id will have at max this RPM limit
  • tpd_limit: The TPD (Tokens Per Day) limit for this team. Batch submissions are charged against it instead of tpm_limit/rpm_limit
  • max_parallel_requests: Most requests all keys of this team may have in flight at once (429 beyond)
  • rpm_limit_type: The type of RPM limit enforcement. Use "guaranteed_throughput" to raise an error if overallocating RPM, or "best_effort_throughput" for best effort enforcement.
  • tpm_limit_type: The type of TPM limit enforcement. Use "guaranteed_throughput" to raise an error if overallocating TPM, or "best_effort_throughput" for best effort enforcement.
  • max_budget: The maximum budget allocated to the team - all keys for this team_id will have at max this max_budget
  • soft_budget: The soft budget threshold for the team. If max_budget is set, soft_budget must be strictly lower than max_budget. Can be set independently if max_budget is not set.
  • budget_duration: The duration of the budget for the team. Doc here
  • models: A list of models associated with the team - all keys for this team_id will have at most, these models. If empty, assumes all models are allowed.
  • blocked: Flag indicating if the team is blocked or not - will stop all calls from keys with this team_id.
  • members: Control team members via /team/member/add and /team/member/delete.
  • tags: Tags for tracking spend and/or doing tag-based routing.
  • prompts: List of prompts that the team is allowed to use.
  • organization_id: The organization id of the team. Default is None. Create via /organization/new.
  • model_aliases: Model aliases for the team. Docs
  • model_max_budget: Per-model max budget every key on the team inherits unless the key sets its own for that model. Example: {"gpt-4o": {"max_budget": 10, "budget_duration": "1d"}}
  • guardrails: Guardrails for the team. Docs
  • policies: Policies for the team. Docs
  • disable_global_guardrails: Whether to disable global guardrails for the team. Proxy admin only.
  • require_trace_id: Reject LLM, MCP and agent requests from this team that carry no trace ID.
  • provider_preferences: Default provider preferences (order, only, ignore, sort, max_price, allow_fallbacks) for this team's chat, responses, messages, completions and embeddings requests. Keys and requests can narrow them but never widen them. Proxy admin only. Stored in metadata.
  • object_permission: team-specific object permission. Example - {"vector_stores": ["vector_store_1", "vector_store_2"], "agents": ["agent_1", "agent_2"], "agent_access_groups": ["dev_group"]}. IF null or {} then no object permission.
  • team_member_budget: The maximum budget allocated to an individual team member.
  • team_member_budget_duration: The duration of the budget for the team member. Doc here
  • team_member_model_max_budget: Per-model budgets shared by team members without an override.
  • team_member_rpm_limit: The RPM (Requests Per Minute) limit for individual team members.
  • team_member_tpm_limit: The TPM (Tokens Per Minute) limit for individual team members.
  • team_member_key_duration: The duration for a team member's key. e.g. "1d", "1w", "1mo"
  • allowed_passthrough_routes: List of allowed pass through routes for the team.
  • denied_passthrough_routes: List of pass through routes the team's keys may not call, even if allowed. Applies together with each key's denied_passthrough_routes.
  • allowed_vector_store_indexes: List of allowed vector store indexes for the key. Example - [{"index_name": "my-index", "index_permissions": ["write", "read"]}]. If specified, the key will only be able to use these specific vector store indexes. Create index, using /v1/indexes endpoint.
  • secret_manager_settings: Secret manager settings for the team. Docs
  • router_settings: team-specific router settings. Example - {"model_group_retry_policy": {"gpt-4": {"RateLimitErrorRetries": 5}}}. IF null or {} then no router settings.
  • access_group_ids: List of access group IDs to associate with the team. Access groups define which models the team can access. Example - ["access_group_1", "access_group_2"].
  • enforced_file_expires_after: Enforced file expiration policy for the team. Keys created under this team will inherit this policy for file uploads. Example - {"anchor": "created_at", "days": 30}.
  • enforced_batch_output_expires_after: Enforced batch output file expiration policy for the team. Keys created under this team will inherit this policy for batch output files. Example - {"anchor": "created_at", "days": 30}.
  • budget_limits: List of concurrent budget windows for the team. Each window specifies a budget_limit, time_period, and optional budget_duration. Example - [{"budget_limit": 10.0, "time_period": "1d"}, {"budget_limit": 50.0, "time_period": "7d"}].
  • default_team_member_models: Default models assigned to new team members when they join this team. Must be a subset of the team's models.

What you get back:

  • team_id: Unique team id, used for tracking spend across multiple keys for the same team.

_deprecated_params:

  • admins: A list of user_id's for the admin role
  • users: A list of user_id's for the user role
  • allowed_ips: IP addresses or CIDR ranges the team's keys may be used from, at most 256 entries. A request from any other client address is refused. Example - ["10.0.0.5", "10.0.0.0/8", "2001:db8::/32"]
  • data_policy: Data policy every request on the team's keys must satisfy: require_zdr, forbid_training, restrict_code_traffic, scan_content_for_code and allowed_regions. The router drops every deployment that does not meet it. Example - {"require_zdr": true, "allowed_regions": ["eu"]}

Example Request:

curl --location 'http://0.0.0.0:4000/team/new' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data '{
"team_alias": "my-new-team_2",
"members_with_roles": [{"role": "admin", "user_id": "user-1234"},
{"role": "user", "user_id": "user-2434"}]
}'

curl --location 'http://0.0.0.0:4000/team/new' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data '{
"team_alias": "QA Prod Bot",
"max_budget": 0.000000001,
"budget_duration": "1d"
}'

Parameters:

NameInTypeRequiredDescription
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, schema NewTeamRequest):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstring or nullNoTeam Id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoHow often the team's spend resets, for example 30d
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsUpdateRouterConfig or nullNoRouter Settings
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
model_aliasesobject or nullNoModel Aliases
model_max_budgetobject or nullNoMax budget per model for every key on the team, overridable per key (e.g. {'gpt-4o': {'max_budget': 10, 'budget_duration': '1d'}})
tagsarray of any or nullNoTags
guardrailsarray of string or nullNoGuardrails
policiesarray of string or nullNoPolicies
promptsarray of string or nullNoPrompts
object_permissionSpanway_ObjectPermissionBase or nullNo
allowed_passthrough_routesarray of any or nullNoAllowed Passthrough Routes
denied_passthrough_routesarray of string or nullNoDenied Passthrough Routes
allowed_ipsarray of string or nullNoAllowed Ips
disable_global_guardrailsboolean or nullNoDisable Global Guardrails
require_trace_idboolean or nullNoRequire Trace Id
provider_preferencesobject or nullNoProvider Preferences
data_policyobject or nullNoData Policy
max_parallel_requestsinteger or nullNoMost requests the whole team may have in flight at once, beyond it a 429
secret_manager_settingsobject or nullNoSecret Manager Settings
model_rpm_limitobject or nullNoRequests per minute for each model, shared by the team's keys
rpm_limit_typeenum: "guaranteed_throughput", "best_effort_throughput" or nullNoguaranteed_throughput refuses a rpm_limit that would overbook the organization's RPM
tpm_limit_typeenum: "guaranteed_throughput", "best_effort_throughput" or nullNoguaranteed_throughput refuses a tpm_limit that would overbook the organization's TPM
model_tpm_limitobject or nullNoTokens per minute for each model, shared by the team's keys
default_estimated_output_tokensinteger or nullNoDefault Estimated Output Tokens
default_estimated_output_tokens_per_modelobject or nullNoDefault Estimated Output Tokens Per Model
mcp_rpm_limitobject or nullNoMcp Rpm Limit
team_member_budgetnumber or nullNoTeam Member Budget
team_member_rpm_limitinteger or nullNoTeam Member Rpm Limit
team_member_tpm_limitinteger or nullNoTeam Member Tpm Limit
team_member_key_durationstring or nullNoTeam Member Key Duration
team_member_budget_durationstring or nullNoTeam Member Budget Duration
team_member_model_max_budgetobject or nullNoTeam Member Model Max Budget
allowed_vector_store_indexesarray of AllowedVectorStoreIndexItem or nullNoAllowed Vector Store Indexes
enforced_batch_output_expires_afterobject or nullNoEnforced Batch Output Expires After
enforced_file_expires_afterobject or nullNoEnforced File Expires After

Example request:

curl -X POST "http://localhost:4000/team/new" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_alias": "data-science",
"max_budget": 500,
"budget_duration": "30d",
"soft_budget": 400,
"tpm_limit": 200000,
"rpm_limit": 600,
"max_parallel_requests": 20,
"models": [
"claude-sonnet-5-5",
"claude-haiku-5-5"
],
"members_with_roles": [
{
"role": "admin",
"user_id": "user-123"
}
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_TeamTable
400The team id is taken or reserved, or a budget value is invalidapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license allows no more teams, or the caller may not create teamsapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

POST /team/update​

Update a team

Use /team/member_add AND /team/member/delete to add/remove new team members

You can now update team budget / rate limits via /team/update

What to send:

  • team_id: The team id of the user. Required param.
  • team_alias: User defined team alias
  • team_member_permissions: A list of routes that non-admin team members can access. example: ["/key/generate", "/key/update", "/key/delete"]
  • metadata: Metadata for team, store information for team. Example metadata = {"team": "core-infra", "app": "app2", "email": "user@example.com" }
  • tpm_limit: The TPM (Tokens Per Minute) limit for this team - all keys with this team_id will have at max this TPM limit
  • rpm_limit: The RPM (Requests Per Minute) limit for this team - all keys associated with this team_id will have at max this RPM limit
  • tpd_limit: The TPD (Tokens Per Day) limit for this team. Batch submissions are charged against it instead of tpm_limit/rpm_limit
  • max_parallel_requests: Most requests all keys of this team may have in flight at once (429 beyond)
  • max_budget: The maximum budget allocated to the team - all keys for this team_id will have at max this max_budget
  • soft_budget: The soft budget threshold for the team. If max_budget is set (either in the request or existing), soft_budget must be strictly lower than max_budget. Can be set independently if max_budget is not set.
  • budget_duration: The duration of the budget for the team. Doc here
  • models: A list of models associated with the team - all keys for this team_id will have at most, these models. If empty, assumes all models are allowed.
  • prompts: List of prompts that the team is allowed to use.
  • blocked: Flag indicating if the team is blocked or not - will stop all calls from keys with this team_id.
  • tags: Tags for tracking spend and/or doing tag-based routing.
  • organization_id: The organization id of the team. Default is None. Create via /organization/new.
  • model_aliases: Model aliases for the team. Docs
  • model_max_budget: Per-model max budget every key on the team inherits unless the key sets its own for that model. Example: {"gpt-4o": {"max_budget": 10, "budget_duration": "1d"}}
  • guardrails: Guardrails for the team. Docs
  • policies: Policies for the team. Docs
  • disable_global_guardrails: Whether to disable global guardrails for the team. Proxy admin only.
  • require_trace_id: Reject LLM, MCP and agent requests from this team that carry no trace ID.
  • provider_preferences: Default provider preferences (order, only, ignore, sort, max_price, allow_fallbacks) for this team's chat, responses, messages, completions and embeddings requests. Keys and requests can narrow them but never widen them. Proxy admin only. Stored in metadata.
  • object_permission: team-specific object permission. Example - {"vector_stores": ["vector_store_1", "vector_store_2"], "agents": ["agent_1", "agent_2"], "agent_access_groups": ["dev_group"]}. IF null or {} then no object permission.
  • team_member_budget: The maximum budget allocated to an individual team member.
  • team_member_budget_duration: The duration of the budget for the team member. Doc here
  • team_member_model_max_budget: Per-model budgets shared by team members without an override.
  • team_member_rpm_limit: The RPM (Requests Per Minute) limit for individual team members.
  • team_member_tpm_limit: The TPM (Tokens Per Minute) limit for individual team members.
  • team_member_key_duration: The duration for a team member's key. e.g. "1d", "1w", "1mo"
  • allowed_passthrough_routes: List of allowed pass through routes for the team.
  • denied_passthrough_routes: List of pass through routes the team's keys may not call, even if allowed. Applies together with each key's denied_passthrough_routes.
  • model_rpm_limit: The RPM (Requests Per Minute) limit per model for this team. Example: {"gpt-4": 100, "gpt-3.5-turbo": 200}
  • model_tpm_limit: The TPM (Tokens Per Minute) limit per model for this team. Example: {"gpt-4": 10000, "gpt-3.5-turbo": 20000}
  • default_estimated_output_tokens: Expected output tokens reserved for TPM limiting when a request omits max_tokens, for keys on this team that do not set their own. Positive integer.
  • default_estimated_output_tokens_per_model: Per-model override of the above. Example: {"gpt-4": 4096, "gpt-3.5-turbo": 1024}
  • mcp_rpm_limit: Per-MCP-server RPM limit for this team, keyed by MCP server name (alias if set, else the configured name). Example: {"jira": 100, "slack": 200}. Applied across all keys for this team. Example - update team TPM Limit
  • allowed_vector_store_indexes: List of allowed vector store indexes for the key. Example - [{"index_name": "my-index", "index_permissions": ["write", "read"]}]. If specified, the key will only be able to use these specific vector store indexes. Create index, using /v1/indexes endpoint.
  • secret_manager_settings: Secret manager settings for the team. Docs
  • router_settings: team-specific router settings. Example - {"model_group_retry_policy": {"gpt-4": {"RateLimitErrorRetries": 5}}}. IF null or {} then no router settings.
  • access_group_ids: List of access group IDs to associate with the team. Access groups define which models the team can access. Example - ["access_group_1", "access_group_2"].
  • enforced_file_expires_after: Enforced file expiration policy for the team. Keys created under this team will inherit this policy for file uploads. Example - {"anchor": "created_at", "days": 30}.
  • enforced_batch_output_expires_after: Enforced batch output file expiration policy for the team. Keys created under this team will inherit this policy for batch output files. Example - {"anchor": "created_at", "days": 30}.
  • budget_limits: List of concurrent budget windows for the team. Each window specifies a budget_limit, time_period, and optional budget_duration. Example - [{"budget_limit": 10.0, "time_period": "1d"}, {"budget_limit": 50.0, "time_period": "7d"}].
  • default_team_member_models: Default models assigned to new team members when they join this team. Must be a subset of the team's models.
curl --location 'http://0.0.0.0:4000/team/update' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data-raw '{
"team_id": "8d916b1c-510d-4894-a334-1c16a93344f5",
"tpm_limit": 100
}'

Example - Update Team max_budget budget

curl --location 'http://0.0.0.0:4000/team/update' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data-raw '{
"team_id": "8d916b1c-510d-4894-a334-1c16a93344f5",
"max_budget": 10
}'

Parameters:

NameInTypeRequiredDescription
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, schema UpdateTeamRequest):

FieldTypeRequiredDescription
team_idstringYesTeam Id
team_aliasstring or nullNoTeam Alias
organization_idstring or nullNoOrganization Id
metadataobject or nullNoMetadata
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoTpd Limit
max_parallel_requestsinteger or nullNoMost requests the whole team may have in flight at once, beyond it a 429
max_budgetnumber or nullNoMax Budget
soft_budgetnumber or nullNoSoft Budget
modelsarray of any or nullNoModels
blockedboolean or nullNoBlocked
budget_durationstring or nullNoBudget Duration
tagsarray of any or nullNoTags
model_aliasesobject or nullNoModel Aliases
guardrailsarray of string or nullNoGuardrails
policiesarray of string or nullNoPolicies
object_permissionSpanway_ObjectPermissionBase or nullNo
disable_global_guardrailsboolean or nullNoDisable Global Guardrails
require_trace_idboolean or nullNoRequire Trace Id
provider_preferencesobject or nullNoProvider Preferences
data_policyobject or nullNoData Policy
team_member_budgetnumber or nullNoTeam Member Budget
team_member_budget_durationstring or nullNoTeam Member Budget Duration
team_member_model_max_budgetobject or nullNoTeam Member Model Max Budget
team_member_rpm_limitinteger or nullNoTeam Member Rpm Limit
team_member_tpm_limitinteger or nullNoTeam Member Tpm Limit
team_member_key_durationstring or nullNoTeam Member Key Duration
allowed_passthrough_routesarray of any or nullNoAllowed Passthrough Routes
denied_passthrough_routesarray of string or nullNoDenied Passthrough Routes
allowed_ipsarray of string or nullNoAllowed Ips
secret_manager_settingsobject or nullNoSecret Manager Settings
promptsarray of string or nullNoPrompts
model_rpm_limitobject or nullNoRequests per minute for each model, shared by the team's keys
model_tpm_limitobject or nullNoTokens per minute for each model, shared by the team's keys
default_estimated_output_tokensinteger or nullNoDefault Estimated Output Tokens
default_estimated_output_tokens_per_modelobject or nullNoDefault Estimated Output Tokens Per Model
mcp_rpm_limitobject or nullNoMcp Rpm Limit
allowed_vector_store_indexesarray of AllowedVectorStoreIndexItem or nullNoAllowed Vector Store Indexes
enforced_batch_output_expires_afterobject or nullNoEnforced Batch Output Expires After
enforced_file_expires_afterobject or nullNoEnforced File Expires After
router_settingsUpdateRouterConfig or nullNoRouter Settings
access_group_idsarray of string or nullNoAccess Group Ids
budget_limitsarray of BudgetLimitEntry or nullNoBudget Limits
default_team_member_modelsarray of string or nullNoDefault Team Member Models
model_max_budgetobject or nullNoMax budget per model for every key on the team, overridable per key (e.g. {'gpt-4o': {'max_budget': 10, 'budget_duration': '1d'}})

Example request:

curl -X POST "http://localhost:4000/team/update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"max_budget": 800,
"tpm_limit": 200000,
"max_parallel_requests": 20
}'

Responses:

StatusDescriptionBody
200The team after the changeapplication/json TeamUpdateResponse
400A budget value is invalid or no team id was sentapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403A team admin sent a field proxy admins have not opened to team adminsapplication/json ProxyError
404No team has that team_idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
team_idstringYesThe team that changed
dataSpanway_TeamTableYesThe team after the change

PATCH /team/{team_id}​

Update a team by id

Partially update a team using RFC 7386 JSON Merge Patch semantics.

team_id is taken from the path; a team_id in the body is accepted only when it matches. metadata is merged with the team's stored metadata rather than replacing it: an omitted key is preserved, key: null deletes it, and any other value overwrites (recursing into nested objects). Every other field behaves exactly like POST /team/update (omitted preserves, a value overwrites). Returns the full updated team.

curl --location --request PATCH 'http://0.0.0.0:4000/team/8d916b1c-510d-4894-a334-1c16a93344f5' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data-raw '{
"metadata": {"cost_center": "1234", "deprecated_key": null}
}'

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, schema PatchTeamRequest):

FieldTypeRequiredDescription
team_idstring or nullNoTeam Id
team_aliasstring or nullNoTeam Alias
organization_idstring or nullNoOrganization Id
metadataobject or nullNoMetadata
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoTpd Limit
max_parallel_requestsinteger or nullNoMost requests the whole team may have in flight at once, beyond it a 429
max_budgetnumber or nullNoMax Budget
soft_budgetnumber or nullNoSoft Budget
modelsarray of any or nullNoModels
blockedboolean or nullNoBlocked
budget_durationstring or nullNoBudget Duration
tagsarray of any or nullNoTags
model_aliasesobject or nullNoModel Aliases
guardrailsarray of string or nullNoGuardrails
policiesarray of string or nullNoPolicies
object_permissionSpanway_ObjectPermissionBase or nullNo
disable_global_guardrailsboolean or nullNoDisable Global Guardrails
require_trace_idboolean or nullNoRequire Trace Id
provider_preferencesobject or nullNoProvider Preferences
data_policyobject or nullNoData Policy
team_member_budgetnumber or nullNoTeam Member Budget
team_member_budget_durationstring or nullNoTeam Member Budget Duration
team_member_model_max_budgetobject or nullNoTeam Member Model Max Budget
team_member_rpm_limitinteger or nullNoTeam Member Rpm Limit
team_member_tpm_limitinteger or nullNoTeam Member Tpm Limit
team_member_key_durationstring or nullNoTeam Member Key Duration
allowed_passthrough_routesarray of any or nullNoAllowed Passthrough Routes
denied_passthrough_routesarray of string or nullNoDenied Passthrough Routes
allowed_ipsarray of string or nullNoAllowed Ips
secret_manager_settingsobject or nullNoSecret Manager Settings
promptsarray of string or nullNoPrompts
model_rpm_limitobject or nullNoRequests per minute for each model, shared by the team's keys
model_tpm_limitobject or nullNoTokens per minute for each model, shared by the team's keys
default_estimated_output_tokensinteger or nullNoDefault Estimated Output Tokens
default_estimated_output_tokens_per_modelobject or nullNoDefault Estimated Output Tokens Per Model
mcp_rpm_limitobject or nullNoMcp Rpm Limit
allowed_vector_store_indexesarray of AllowedVectorStoreIndexItem or nullNoAllowed Vector Store Indexes
enforced_batch_output_expires_afterobject or nullNoEnforced Batch Output Expires After
enforced_file_expires_afterobject or nullNoEnforced File Expires After
router_settingsUpdateRouterConfig or nullNoRouter Settings
access_group_idsarray of string or nullNoAccess Group Ids
budget_limitsarray of BudgetLimitEntry or nullNoBudget Limits
default_team_member_modelsarray of string or nullNoDefault Team Member Models
model_max_budgetobject or nullNoMax budget per model for every key on the team, overridable per key (e.g. {'gpt-4o': {'max_budget': 10, 'budget_duration': '1d'}})

Example request:

curl -X PATCH "http://localhost:4000/team/team_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_budget": 800,
"models": [
"claude-sonnet-5-5",
"gpt-6.1-sol"
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_TeamTable
400The body names another team or a budget value is invalidapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403A team admin sent a field proxy admins have not opened to team adminsapplication/json ProxyError
404No team has that team_idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

POST /team/member_add​

Add members to a team

Adds one or more people to a team, by user_id or user_email, so their keys can use the team's models and budget. A user that does not exist yet is created. max_budget_in_team gives each new member a spending limit inside the team. Proxy admins and the team's admins may call it, adding a member with the admin role needs an Enterprise license, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/member_add' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "team-ds", "member": {"role": "user", "user_id": "user-123"}, "max_budget_in_team": 50}'

Request body (application/json, schema TeamMemberAddRequest):

FieldTypeRequiredDescription
memberarray of Member or MemberYesMember object or list of member objects to add. Each member must include either user_id or user_email, and a role
team_idstringYesThe ID of the team to add the member to
max_budget_in_teamnumber or nullNoMaximum budget allocated to this user within the team. If not set, user has unlimited budget within team limits
budget_durationstring or nullNoDuration after which this team member's budget resets (e.g. '1h', '24h', '7d', '30d'). If not set, the budget never resets.
allowed_modelsarray of string or nullNoList of models this team member can access. If not set, inherits the team's default_team_member_models or all team models.

Example request:

curl -X POST "http://localhost:4000/team/member_add" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"member": {
"role": "user",
"user_id": "user-123"
},
"max_budget_in_team": 50
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json TeamAddMemberResponse
400No member was sent, or admin roles need an Enterprise licenseapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Only proxy admins and the team's admins may add membersapplication/json ErrorDetail
404No team has that team_idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At
updated_usersarray of Spanway_UserTableYesUpdated Users
updated_team_membershipsarray of Spanway_TeamMembershipYesUpdated Team Memberships

POST /team/member_delete​

Remove a member from a team

Removes a member from a team, by user_id or user_email, together with their budget in the team. The team and its keys stay. Proxy admins and the team's admins may call it, an unknown team answers 404, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/member_delete' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "team-ds", "user_id": "user-123"}'

Request body (application/json, schema TeamMemberDeleteRequest):

FieldTypeRequiredDescription
user_idstring or nullNoUser Id
user_emailstring or nullNoUser Email
team_idstringYesTeam Id

Example request:

curl -X POST "http://localhost:4000/team/member_delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"user_id": "user-123"
}'

Responses:

StatusDescriptionBody
200The team without the removed memberapplication/json Spanway_TeamTable
400The request names no member, or the member is not on the teamapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller is not a proxy admin or team admin, or member removal is turned off for team adminsapplication/json ErrorDetail
404No team has that team_idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

POST /team/member_update​

Change a member's role or budget in a team

Changes one member's role or limits inside a team: role, max_budget_in_team, tpm_limit, rpm_limit, max_parallel_requests (how many requests the member may have in flight at once in the team) and budget_duration. Proxy admins and the team's admins may call it, making someone a team admin needs an Enterprise license, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/member_update' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "team-ds", "user_id": "user-123", "role": "admin", "max_budget_in_team": 75}'

Request body (application/json, schema TeamMemberUpdateRequest):

FieldTypeRequiredDescription
user_idstring or nullNoUser Id
user_emailstring or nullNoUser Email
team_idstringYesTeam Id
max_budget_in_teamnumber or nullNoMax Budget In Team
roleenum: "admin", "user" or nullNoRole
tpm_limitinteger or nullNoTokens per minute limit for this team member
rpm_limitinteger or nullNoRequests per minute limit for this team member
max_parallel_requestsinteger or nullNoMost requests this team member may have in flight at once in the team
budget_durationstring or nullNoDuration after which this team member's budget resets (e.g. '1h', '24h', '7d', '30d'). If not set, the budget never resets.
allowed_modelsarray of string or nullNoList of models this team member can access. Pass an empty list to remove per-member model restrictions.
temp_budget_increasenumber or nullNoTemporary additive budget increase for this team member, active until temp_budget_expiry
temp_budget_expirystring or nullNoUTC expiry for temp_budget_increase
model_max_budgetobject or nullNoPer-model spend caps for this team member, each with its own budget_duration. Overrides the team's default per-model member budget. Pass an empty dict to fall back to the team default.

Example request:

curl -X POST "http://localhost:4000/team/member_update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"user_id": "user-123",
"role": "admin",
"max_budget_in_team": 75,
"max_parallel_requests": 4
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json TeamMemberUpdateResponse
400The member is not on the teamapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Only proxy admins and the team's admins may change membersapplication/json ErrorDetail
404No team has that team_idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
user_idstringYesUser Id
user_emailstring or nullNoUser Email
team_idstringYesTeam Id
max_budget_in_teamnumber or nullNoMax Budget In Team
tpm_limitinteger or nullNoTpm Limit
rpm_limitinteger or nullNoRpm Limit
max_parallel_requestsinteger or nullNoMax Parallel Requests
budget_durationstring or nullNoBudget Duration
allowed_modelsarray of string or nullNoAllowed Models
temp_budget_increasenumber or nullNoTemp Budget Increase
temp_budget_expirystring or nullNoTemp Budget Expiry
model_max_budgetobject or nullNoModel Max Budget

POST /team/{team_id}/member/{user_id}/reset_spend​

Reset a member's spend in a team

Sets a team member's spend inside the team back to zero, or to reset_to, so a member who hit their team budget can work again. This spend is tracked apart from the member's personal budget and the team's own budget, so neither /user/update nor /team/update clears it. The change takes effect on the member's next request. Proxy admins and the team's or organization's admins may call it, only a proxy admin may reset their own spend, and the before and after values go to the audit log.

curl -X POST 'http://localhost:4000/team/team-ds/member/user-123/reset_spend' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"reset_to": 0}'

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes
user_idpathstringYes

Request body (application/json, schema ResetSpendRequest):

FieldTypeRequiredDescription
reset_tonumberYesReset To

Example request:

curl -X POST "http://localhost:4000/team/team_id-123/member/user_id-123/reset_spend" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reset_to": 0
}'

Responses:

StatusDescriptionBody
200The member's spend in the team before and after the resetapplication/json TeamMemberResetSpendResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
team_idstringYesThe team the member belongs to
user_idstringYesThe member whose spend was reset
spendnumberYesThe member's spend in the team after the reset, in USD
previous_spendnumberYesThe member's spend in the team before the reset, in USD
max_budgetnumber or nullYesThe member's budget in the team, null when none is set

POST /team/{team_id}/member/{user_id}/reset_budget​

Reset a member's budget to the team default

Puts a team member back on the team's default member budget (team_member_budget) by dropping the member's own budget, so later team-wide budget changes reach them again. A team with no default leaves the member with no budget. Spend is not touched. Proxy admins and the team's admins may call it, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/team-ds/member/user-123/reset_budget' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY"

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes
user_idpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/team/team_id-123/member/user_id-123/reset_budget" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json TeamMemberResetBudgetResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
team_idstringYesTeam Id
user_idstringYesUser Id
budget_idstring or nullYesBudget Id
previous_budget_idstring or nullYesPrevious Budget Id
budget_sourceenum: "team_default", "custom", "none"YesBudget Source

POST /team/bulk_member_add​

Add many members to a team at once

Bulk add multiple members to a team at once.

This endpoint reuses the same logic as /team/member_add but provides a bulk-friendly response format.

What to send:

  • team_id: The ID of the team to add members to
  • members: List of members to add to the team
  • all_users: Flag to add all users on Proxy to the team
  • max_budget_in_team: Maximum budget allocated to each user within the team

What you get back:

  • results: of individual member addition results
  • total_requested: Total number of members requested for addition
  • successful_additions: Number of successful additions
  • failed_additions: Number of failed additions
  • updated_team: The updated team object

Example request:

curl --location 'http://0.0.0.0:4000/team/bulk_member_add' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data '{
"team_id": "team-1234",
"members": [
{
"user_id": "user1",
"role": "user"
},
{
"user_email": "user2@example.com",
"role": "admin"
}
],
"max_budget_in_team": 100.0
}'

Request body (application/json, schema BulkTeamMemberAddRequest):

FieldTypeRequiredDescription
team_idstringYesTeam Id
membersarray of Member or nullNoMembers
all_usersboolean or nullNoAll Users
max_budget_in_teamnumber or nullNoMax Budget In Team

Example request:

curl -X POST "http://localhost:4000/team/bulk_member_add" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"members": [
{
"role": "user",
"user_id": "user-123"
},
{
"role": "user",
"user_email": "ana@example.com"
}
],
"max_budget_in_team": 50
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json BulkTeamMemberAddResponse
400The request is malformed or breaks a rule named in the detailapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
team_idstringYesTeam Id
resultsarray of TeamMemberAddResultYesResults
total_requestedintegerYesTotal Requested
successful_additionsintegerYesSuccessful Additions
failed_additionsintegerYesFailed Additions
updated_teamobject or nullNoUpdated Team

POST /team/delete​

Delete teams

Deletes one or more teams and the keys that belong to them, so those keys stop working at once. The team rows are kept in the deleted teams list for reporting. Proxy admins may delete any team, team and organization admins the teams they manage, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/delete' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_ids": ["team-ds"]}'

Parameters:

NameInTypeRequiredDescription
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, schema DeleteTeamRequest):

FieldTypeRequiredDescription
team_idsarray of stringYesTeam Ids

Example request:

curl -X POST "http://localhost:4000/team/delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_ids": [
"team-ds"
]
}'

Responses:

StatusDescriptionBody
200The teams that were deletedapplication/json TeamDeleteResponse
400No team id was sentapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Only proxy admins and the team's admins may delete itapplication/json ErrorDetail
404No team has that team_idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
deleted_teamsarray of stringYesThe ids of the teams that were deleted

GET /team/info​

Get a team with its keys and members

Reads one team with its settings, budget, members, the keys that belong to it and each member's spend in the team. Proxy admins and admin viewers can read any team, everyone else only teams they belong to or manage. key_limit caps how many keys come back. Nothing changes.

curl 'http://localhost:4000/team/info?team_id=team-ds' \
-H "Authorization: Bearer sk-..."

Parameters:

NameInTypeRequiredDescription
team_idquerystringNoTeam ID in the request parameters
key_limitqueryinteger or nullNoLimit the number of keys returned

Example request:

curl -X GET "http://localhost:4000/team/info" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The team with its keys and member budgetsapplication/json TeamInfoResponseObject
401No valid key or Admin UI session was presentedapplication/json ProxyError
403User=user-7 not authorized to access this team=team-ds or Team key for team=team-ops not authorized to access this team=team-dsapplication/json ProxyError
404Team not found, passed team_id=team-dsapplication/json ProxyError
422Malformed request. No team id passed in.application/json ProxyError
500Database not connected. Connect a database to your proxy - https://docs.spanway.ai/docs/simple_proxy#managing-auth---virtual-keysapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
team_idstringYesTeam Id
team_infoTeamInfoResponseObjectTeamTableYes
keysarray of anyYesKeys
team_membershipsarray of TeamInfoMembershipYesTeam Memberships

GET /team/{team_id}/members/me​

Your own membership in a team

Reads the caller's own membership in a team: their spend, budget, reset date, rate limits and role, without showing other members. The caller comes from the key, so /members/me always means the caller. Any member may call it, a caller who is not a member gets 404, and nothing changes.

curl 'http://localhost:4000/team/team-ds/members/me' \
-H "Authorization: Bearer sk-..."

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/team/team_id-123/members/me" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json TeamMemberInfoResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
user_idstringYesUser Id
team_idstringYesTeam Id
budget_idstring or nullNoBudget Id
spendnumber or nullNoSpend
total_spendnumber or nullNoTotal Spend
spanway_budget_tableSpanway_BudgetTableFull or Spanway_BudgetTable or nullNoSpanway Budget Table
rolestring or nullNoRole
user_emailstring or nullNoUser Email
team_aliasstring or nullNoTeam Alias

POST /team/block​

Block a team

Blocks a team: every request made with one of the team's keys is refused until the team is unblocked, which is the quick way to stop runaway spend or a leaked key. Proxy admins and the team's admins may call it, and the change is written to the audit log. The answer is the team with blocked set to true.

curl -X POST 'http://localhost:4000/team/block' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "team-ds"}'

Request body (application/json, schema BlockTeamRequest):

FieldTypeRequiredDescription
team_idstringYesTeam Id

Example request:

curl -X POST "http://localhost:4000/team/block" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds"
}'

Responses:

StatusDescriptionBody
200The team, now blockedapplication/json Spanway_TeamTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

POST /team/unblock​

Unblock a team

Unblocks a team so its keys work again. A team the gateway blocked by itself, for example after a security event, can only be unblocked by a proxy admin. Proxy admins and the team's admins may call it otherwise, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/unblock' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "team-ds"}'

Request body (application/json, schema BlockTeamRequest):

FieldTypeRequiredDescription
team_idstringYesTeam Id

Example request:

curl -X POST "http://localhost:4000/team/unblock" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds"
}'

Responses:

StatusDescriptionBody
200The team, no longer blockedapplication/json Spanway_TeamTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

GET /team/metadata_schema​

Fields allowed in team metadata

Lists the team metadata fields an admin declared in general_settings.team_metadata_schema, so the Admin UI can offer them in the team form. It answers an empty list when none are declared. The list is a guide only, the gateway does not reject other keys. Any authenticated key may call it, and nothing changes.

Example request:

curl -X GET "http://localhost:4000/team/metadata_schema" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json TeamMetadataSchemaResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
fieldsarray of TeamMetadataFieldSchemaYesFields

GET /team/available​

Teams the caller may join

Lists the teams an admin opened for self-service joining, through default_internal_user_params.available_teams in the config, that the caller is not a member of yet. Any user may call it, it answers an empty list when no team is open for joining, and nothing changes.

Example request:

curl -X GET "http://localhost:4000/team/available" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json array of Spanway_TeamTable
400The gateway runs without a databaseapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
404The caller's key has no userapplication/json ErrorDetail

GET /v2/team/list​

List teams with paging and filters

Get a paginated list of teams with filtering and sorting options.

What to send: user_id Only return teams which this user belongs to organization_id Only return teams which belong to this organization team_id Filter teams by exact team_id match team_alias Filter teams by partial team_alias match page The page number to return page_size The number of items per page sort_by Column to sort by (e.g. 'team_id', 'team_alias', 'created_at') sort_order Sort order ('asc' or 'desc') status Filter by status. Currently supports "deleted" to query deleted teams.

Parameters:

NameInTypeRequiredDescription
user_idquerystring or nullNoOnly return teams which this 'user_id' belongs to
organization_idquerystring or nullNoOnly return teams which this 'organization_id' belongs to
team_idquerystring or nullNoOnly return teams which this 'team_id' belongs to
team_aliasquerystring or nullNoOnly return teams which this 'team_alias' belongs to. Supports partial matching.
searchquerystring or nullNoCombined search: matches teams whose 'team_id' matches the value OR whose 'team_alias' contains it (case-insensitive).
search_team_id_matchqueryenum: "exact", "prefix"NoHow 'search' matches 'team_id': 'exact' (default) or 'prefix' for a case-sensitive prefix match.
pagequeryintegerNoPage number for pagination
page_sizequeryintegerNoNumber of teams per page
sort_byquerystring or nullNoColumn to sort by (e.g. 'team_id', 'team_alias', 'created_at')
sort_orderquerystringNoSort order ('asc' or 'desc')
statusquerystring or nullNoFilter by status (e.g. 'deleted')

Example request:

curl -X GET "http://localhost:4000/v2/team/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json TeamListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
teamsarray of TeamListItem or Spanway_TeamTable or Spanway_DeletedTeamTableYesTeams
totalintegerYesTotal
pageintegerYesPage
page_sizeintegerYesPage Size
total_pagesintegerYesTotal Pages

GET /team/list​

List teams

Lists the teams the caller may see, each with its memberships and keys. Proxy admins and admin viewers see every team, organization admins the teams of their organizations, and everyone else the teams they belong to. user_id keeps only that user's teams and organization_id only one organization's, with default_organization for teams outside any organization. Nothing changes. For large gateways use /v2/team/list, which pages.

curl 'http://localhost:4000/team/list' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY"

Parameters:

NameInTypeRequiredDescription
user_idquerystring or nullNoOnly return teams which this 'user_id' belongs to
organization_idquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/team/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The teams the caller may see, with their memberships and keysapplication/json array of TeamListResponseObject
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /team/model/add​

Add models to a team

Adds models to the list a team may use, so every key of the team can call them. Proxy admins and the team's admins may call it, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/model/add' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "team-ds", "models": ["gpt-5.5"]}'

Request body (application/json, schema TeamModelAddRequest):

FieldTypeRequiredDescription
team_idstringYesTeam Id
modelsarray of stringYesModels

Example request:

curl -X POST "http://localhost:4000/team/model/add" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"models": [
"gpt-6.1-sol"
]
}'

Responses:

StatusDescriptionBody
200The team with the models addedapplication/json Spanway_TeamTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Only proxy admins and the team's admins may change the team's modelsapplication/json ErrorDetail
404No team has that team_idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

POST /team/model/delete​

Remove models from a team

Removes models from the list a team may use, so the team's keys can no longer call them. Proxy admins and the team's admins may call it, and the change is written to the audit log.

curl -X POST 'http://localhost:4000/team/model/delete' \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "team-ds", "models": ["gpt-5.5"]}'

Request body (application/json, schema TeamModelDeleteRequest):

FieldTypeRequiredDescription
team_idstringYesTeam Id
modelsarray of stringYesModels

Example request:

curl -X POST "http://localhost:4000/team/model/delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"models": [
"gpt-6.1-sol"
]
}'

Responses:

StatusDescriptionBody
200The team with the models removedapplication/json Spanway_TeamTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Only proxy admins and the team's admins may change the team's modelsapplication/json ErrorDetail
404No team has that team_idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

GET /team/permissions_list​

What members of a team may do with keys

Shows which key actions ordinary members of a team may take on the team's keys, for example /key/generate or /key/info, next to every action that can be granted. Proxy admins, admin viewers and the team's admins may call it, and nothing changes.

Parameters:

NameInTypeRequiredDescription
team_idquerystringNoTeam ID in the request parameters

Example request:

curl -X GET "http://localhost:4000/team/permissions_list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json GetTeamMemberPermissionsResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
team_idstringYesTeam Id
team_member_permissionsarray of string or nullNoTeam Member Permissions
all_available_permissionsarray of stringYesAll Available Permissions

POST /team/permissions_update​

Set what members of a team may do with keys

Sets which key actions ordinary members of a team may take on the team's keys, replacing the current list. For example, granting /key/generate lets members create their own keys for the team. Proxy admins and the team's admins may call it, and the before and after lists go to the audit log.

Request body (application/json, schema UpdateTeamMemberPermissionsRequest):

FieldTypeRequiredDescription
team_idstringYesTeam Id
team_member_permissionsarray of stringYesTeam Member Permissions

Example request:

curl -X POST "http://localhost:4000/team/permissions_update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "team-ds",
"team_member_permissions": [
"/key/generate",
"/key/update",
"/key/delete",
"/key/info",
"/key/health"
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_TeamTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
team_aliasstring or nullNoA readable name for the team
team_idstringYesThe team's unique id
organization_idstring or nullNoThe organization the team belongs to
adminsarray of stringNoUser ids of the team's admins
membersarray of stringNoUser ids of the team's members
members_with_rolesarray of MemberNoEvery member with their role in the team, admin or user
team_member_permissionsarray of string or nullNoKey actions ordinary members may take on the team's keys
metadataobject or nullNoFree-form labels for the team, such as a cost center
tpm_limitinteger or nullNoMost tokens per minute all of the team's keys may use together
rpm_limitinteger or nullNoMost requests per minute all of the team's keys may send together
tpd_limitinteger or nullNoMost tokens per day all of the team's keys may use together
max_budgetnumber or nullNoRequests fail once the team's spend passes this, in USD
soft_budgetnumber or nullNoAn alert fires when the team's spend reaches this, in USD
budget_durationstring or nullNoBudget Duration
budget_limitsarray of BudgetLimitEntry or nullNoExtra budget windows, each with its own limit and reset schedule
modelsarray of stringNoModels the team's keys may call, empty for every model
blockedbooleanNoTrue when every request made with the team's keys is refused
router_settingsobject or nullNoRouting settings that apply to the team's requests
access_group_idsarray of string or nullNoAccess groups whose models, MCP servers and agents the team may use
default_team_member_modelsarray of string or nullNoModels a new member may use when none are set for them
spendnumber or nullNoWhat the team has spent in the current budget period, in USD
max_parallel_requestsinteger or nullNoMost requests the team's keys may have in flight at once
budget_reset_atstring or nullNoWhen the team's spend next resets
model_idinteger or nullNoModel Id
model_spendobject or nullNoModel Spend
model_max_budgetobject or nullNoModel Max Budget
policiesarray of string or nullNoPolicies
allow_team_guardrail_configboolean or nullNoAllow Team Guardrail Config
spanway_model_tableSpanway_ModelTable or nullNo
object_permissionSpanway_ObjectPermissionTable or nullNo
object_permission_idstring or nullNoObject Permission Id
updated_atstring or nullNoUpdated At
created_atstring or nullNoCreated At

POST /team/permissions_bulk_update​

Add member permissions to many teams

Adds key actions to the member permissions of many teams at once, either the teams in team_ids or every team with apply_to_all_teams. Actions a team already grants are skipped and nothing is taken away. Proxy admins only, and the change is written to the audit log.

Request body (application/json, schema BulkUpdateTeamMemberPermissionsRequest):

FieldTypeRequiredDescription
permissionsarray of KeyManagementRoutesYesPermissions
team_idsarray of string or nullNoTeam Ids
apply_to_all_teamsbooleanNoApply To All Teams

Example request:

curl -X POST "http://localhost:4000/team/permissions_bulk_update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"permissions": [
"/key/generate",
"/key/update"
],
"team_ids": [
"team-ds",
"team-nlp"
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json BulkUpdateTeamMemberPermissionsResponse
400The request is malformed or breaks a rule named in the detailapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
messagestringYesMessage
teams_updatedintegerYesTeams Updated
permissions_appendedarray of string or nullNoPermissions Appended

GET /team/daily/activity​

Daily spend and usage of a team

Show spend, token counts and request counts per day for one or more teams, one page of days at a time.

Pass team_ids as a comma-separated list to pick teams, or leave it out to see every team you can read, and exclude_team_ids to leave some out. start_date and end_date (YYYY-MM-DD) set the period, model and api_key narrow it to one model or one key, and page and page_size (10 by default) page through the days.

Parameters:

NameInTypeRequiredDescription
team_idsquerystring or nullNo
start_datequerystring or nullNo
end_datequerystring or nullNo
modelquerystring or nullNo
api_keyquerystring or nullNo
pagequeryintegerNo
page_sizequeryintegerNo
exclude_team_idsquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/team/daily/activity" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json SpendAnalyticsPaginatedResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
resultsarray of DailySpendDataYesResults
metadataDailySpendMetadataNo

GET /team/spend/by_user​

Spend per member of a team

Shows how much each user spent inside the given teams between start_date and end_date, with token and request counts, counted per request from the spend logs. Proxy admins may query any team. Team admins and members holding the /team/daily/activity permission see every user of the requested teams, other members only their own row. Nothing changes.

Parameters:

NameInTypeRequiredDescription
team_idsquerystring or nullNo
start_datequerystring or nullNo
end_datequerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/team/spend/by_user" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json TeamUserSpendResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
start_datestringYesStart Date
end_datestringYesEnd Date
resultsarray of TeamUserSpendRowYesResults

POST /management/v1/teams/{team_id}/members/bulk_delete​

Remove many members from a team at once

Remove up to 500 members from one team in one call. Same authorization as /team/member_delete: proxy admins, the team's admins, and admins of the team's organization. Each member is named by exactly one of user_id or user_email; unknown body fields are a 422 and an unknown team is a 404.

When disable_team_admin_delete_team_user is on, callers who are not proxy admins get a 403 problem whose detail names that setting, and nothing is removed. The roster change is written to the audit log with the member list before and after.

data holds one result per requested member, in request order. A row is success: false with an error when it names nobody on the team or repeats an earlier row. The roster is rewritten once, under the team's advisory lock, so a concurrent member_add is never overwritten from a stale read.

Example curl:

curl --location 'http://0.0.0.0:4000/management/v1/teams/team-1/members/bulk_delete' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data '{"members": [{"user_id": "user-1"}, {"user_email": "user-2@example.com"}]}'

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes

Request body (application/json, schema BulkTeamMemberDeleteRequest):

FieldTypeRequiredDescription
membersarray of TeamMemberRefYesMembers

Example request:

curl -X POST "http://localhost:4000/management/v1/teams/team_id-123/members/bulk_delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"members": [
{
"user_id": "user-123"
},
{
"user_email": "ana@example.com"
}
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json BulkTeamMemberDeleteResponse
400Unknown query parameterapplication/problem+json any
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Forbiddenapplication/problem+json any
404Team not foundapplication/problem+json any
422Validation Errorapplication/json HTTPValidationError
500Internal server errorapplication/problem+json any
503Database not connectedapplication/problem+json any

Response fields (200):

FieldTypeRequiredDescription
dataarray of TeamMemberDeleteResultYesData

POST /management/v1/teams/{team_id}/members/bulk_update​

Change many members' budgets in a team at once

Set per-member limits for up to 500 members of one team in one call. Same authorization and member addressing as /team/member_update: proxy admins, the team's admins, and admins of the team's organization, with each member named by exactly one of user_id or user_email. Unknown body fields are a 422 and an unknown team is a 404.

Each row is a merge patch of that member's limits: a field left out is untouched, a field sent as null is cleared, and clearing the last limit drops the member back to the team default. A budget row shared by several memberships, the team default included, is copied for the member being patched rather than written in place, so one member's new cap never lands on anybody else.

data holds one result per requested member, in request order, carrying the limits in force after the write. A row is success: false with an error when it names nobody on the team or repeats an earlier row. Roles are not part of this route; /team/member_update still owns them.

Example curl:

curl --location 'http://0.0.0.0:4000/management/v1/teams/team-1/members/bulk_update' --header "Authorization: Bearer $SPANWAY_MASTER_KEY" --header 'Content-Type: application/json' --data '{"members": [{"user_id": "user-1", "max_budget_in_team": 10}, {"user_email": "user-2@example.com", "max_budget_in_team": 10, "budget_duration": "30d"}]}'

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, schema BulkTeamMemberBudgetUpdateRequest):

FieldTypeRequiredDescription
membersarray of TeamMemberBudgetPatchYesMembers

Example request:

curl -X POST "http://localhost:4000/management/v1/teams/team_id-123/members/bulk_update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"members": [
{
"user_id": "user-123",
"max_budget_in_team": 50
},
{
"user_id": "user-456",
"max_budget_in_team": 50
}
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json BulkTeamMemberBudgetUpdateResponse
400Unknown query parameterapplication/problem+json any
401No valid key or Admin UI session was presentedapplication/json ProxyError
403Forbiddenapplication/problem+json any
404Team not foundapplication/problem+json any
422Validation Errorapplication/json HTTPValidationError
500Internal server errorapplication/problem+json any
503Database not connectedapplication/problem+json any

Response fields (200):

FieldTypeRequiredDescription
dataarray of TeamMemberBudgetUpdateResultYesData

GET /team/{team_id}/callback​

Logging callbacks of a team

Shows which logging callbacks a team sends its successful and failed calls to and the settings each uses, with credentials masked as REDACTED. It covers callbacks added through this API or the Admin UI and teams still on the older callback_settings shape, using the same precedence as at request time. A key's own logging settings override the team's at request time and are not shown here. Proxy admins, admins of the team's organization and admins of the team may call it. Needs a license with scoped_integrations. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/team/team_id-123/callback" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The team's logging callbacks with credentials maskedapplication/json TeamCallbacksResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
status"success"YesAlways success
dataTeamCallbackSettingsYesThe team's logging callbacks

POST /team/{team_id}/callback​

Add a logging callback to a team

Sends one team's request logs to its own observability account, for example its own Langfuse, Langsmith, Google Cloud Storage bucket or New Relic account, instead of or in addition to the gateway's. Choose whether successful calls, failed calls or both are sent with callback_type, and pass the destination's credentials in callback_vars. Credentials are stored encrypted and shown masked afterwards, and keys of the team start using the callback right away.

callback_name must be a callback that supports team credentials, such as langfuse, langfuse_otel, langsmith, gcs or newrelic. Common callback_vars are langfuse_public_key, langfuse_secret_key and langfuse_host for Langfuse, langsmith_api_key, langsmith_project and langsmith_base_url for Langsmith, gcs_bucket_name and gcs_path_service_account for Google Cloud Storage, and newrelic_api_key and newrelic_region for New Relic, which also needs the gateway to run with SPANWAY_OTEL_V2=true. capture_message_content set to no_content or span_only controls whether prompts and responses reach the destination.

Proxy admins, admins of the team's organization and admins of the team may call it. The change is written to the audit log, and the spanway-changed-by header records who the change was made for. Needs a license with scoped_integrations.

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, schema AddTeamCallback):

FieldTypeRequiredDescription
callback_namestringYesThe logging destination, such as langfuse, langsmith, gcs or newrelic
callback_typeenum: "success", "failure", "success_and_failure" or nullNoSend successful calls, failed calls, or both
callback_varsobjectYesThe destination's credentials and settings, such as langfuse_public_key

Example request:

curl -X POST "http://localhost:4000/team/team_id-123/callback" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"callback_name": "langfuse",
"callback_type": "success",
"callback_vars": {
"langfuse_public_key": "pk-lf-example",
"langfuse_secret_key": "sk-lf-example",
"langfuse_host": "https://cloud.langfuse.com"
}
}'

Responses:

StatusDescriptionBody
200The team with its updated logging settingsapplication/json TeamCallbackAdded
400The team does not exist, the callback is already registered for that event, or its settings are invalidapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
status"success"YesAlways success
dataSpanway_TeamTableYesThe team with its updated logging settings in metadata

DELETE /team/{team_id}/callback/{callback_name}​

Remove a logging callback from a team

Removes one logging callback from a team while its other callbacks keep running. Every entry registered under that callback_name is removed, for successful and failed calls alike. Answers 404 when the team does not exist or has no callback with that name, which is also the case for teams still on the older callback_settings shape, where disable_logging clears them. Proxy admins, admins of the team's organization and admins of the team may call it. The change is written to the audit log.

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes
callback_namepathstringYes
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Example request:

curl -X DELETE "http://localhost:4000/team/team_id-123/callback/callback_name-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The callbacks the team still hasapplication/json TeamCallbackDeleteResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
status"success"YesAlways success
messagestringYesWhat was removed
dataTeamCallbackDeleteResponseDataYesThe team's remaining callbacks

POST /team/{team_id}/disable_logging​

Turn off logging callbacks for a team

Turns off every logging callback of a team at once, for example when a team's observability account is being shut down. The registered callbacks and their credentials are cleared, so turning logging back on means adding them again. Proxy admins, admins of the team's organization and admins of the team may call it. The change is written to the audit log even though the team's own logging is now off.

Parameters:

NameInTypeRequiredDescription
team_idpathstringYes
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/team/team_id-123/disable_logging" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Responses:

StatusDescriptionBody
200Logging is off for the teamapplication/json TeamCallbackDeleteResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key's role, grants or license do not allow this actionapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway has no databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
status"success"YesAlways success
messagestringYesWhat was removed
dataTeamCallbackDeleteResponseDataYesThe team's remaining callbacks