> For the complete documentation index, see [llms.txt](https://docs.toolkit.equs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toolkit.equs.ai/api/web-wallet-api/tenant.md).

# Tenant

## Look up a user's agents by name

> Returns the non-deleted agents of a user with this exact name

```json
{"openapi":"3.0.0","info":{"title":"EqusDTK Web Custodial Wallet Documentation","version":"0.1.2"},"tags":[],"security":[{"sp":[]},{"tenant":[]},{"sp":[]}],"components":{"securitySchemes":{"sp":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Service Provider. Token of the Service Provider client in the `agents` realm, with no `tenantId` claim. Authorize one bearer scheme at a time."},"tenant":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Tenant. Token of a Tenant machine client or of a Tenant portal user, carrying the `tenantId` claim. Authorize one bearer scheme at a time."}},"schemas":{"GetTenantAgentsResponse":{"type":"object","properties":{"items":{"description":"The user's non-deleted agents matching the query.","type":"array","items":{"$ref":"#/components/schemas/Agent"}}},"required":["items"]},"Agent":{"type":"object","properties":{"id":{"type":"string","description":"Agent unique ID"},"name":{"type":"string","description":"Display name of the agent."}},"required":["id","name"]}}},"paths":{"/api/v1/tenant/agents":{"get":{"description":"Returns the non-deleted agents of a user with this exact name","operationId":"TenantController_getAgentsByTenant_api/v1","parameters":[{"name":"userId","required":true,"in":"query","description":"User unique ID","schema":{"type":"string"}},{"name":"name","required":true,"in":"query","description":"Restricts the result to agents whose name matches exactly.","schema":{"type":"string"}},{"description":"User unique ID","name":"userId","in":"query","required":true,"schema":{"type":"string"}},{"description":"Restricts the result to agents whose name matches exactly.","name":"name","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The user's non-deleted agents matching the query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTenantAgentsResponse"}}}},"400":{"description":"Request validation failed (e.g. missing userId or name, or unknown query params)"},"401":{"description":"Missing or invalid agents-realm service token"}},"summary":"Look up a user's agents by name","tags":["Tenant"]}}}}
```

## Create an agent for a user

> Creates an agent wallet and a did:web linked to an existing user

```json
{"openapi":"3.0.0","info":{"title":"EqusDTK Web Custodial Wallet Documentation","version":"0.1.2"},"tags":[],"security":[{"sp":[]},{"tenant":[]},{"sp":[]}],"components":{"securitySchemes":{"sp":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Service Provider. Token of the Service Provider client in the `agents` realm, with no `tenantId` claim. Authorize one bearer scheme at a time."},"tenant":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Tenant. Token of a Tenant machine client or of a Tenant portal user, carrying the `tenantId` claim. Authorize one bearer scheme at a time."}},"schemas":{"CreateTenantAgentRequest":{"type":"object","properties":{"agentId":{"type":"string","description":"Agent unique ID"},"userId":{"type":"string","description":"User unique ID"},"name":{"type":"string","description":"The agent name. Ignored when the agent already exists."}},"required":["agentId","userId","name"]}}},"paths":{"/api/v1/tenant/agents":{"post":{"description":"Creates an agent wallet and a did:web linked to an existing user","operationId":"TenantController_createAgentByTenant_api/v1","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantAgentRequest"}}}},"responses":{"201":{"description":"Agent created (or already existing) and provisioned with a did:web identity"},"400":{"description":"Request validation failed (e.g. missing or malformed agentId/userId/name)"},"409":{"description":"The agentId or its did:web is taken (including by an existing holder identity), or the user already has an agent with this name"}},"summary":"Create an agent for a user","tags":["Tenant"]}}}}
```

## Create a wallet and did:web for user

> Creates an agent, along with a did:web, for a user

```json
{"openapi":"3.0.0","info":{"title":"EqusDTK Web Custodial Wallet Documentation","version":"0.1.2"},"tags":[],"security":[{"sp":[]},{"tenant":[]},{"sp":[]}],"components":{"securitySchemes":{"sp":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Service Provider. Token of the Service Provider client in the `agents` realm, with no `tenantId` claim. Authorize one bearer scheme at a time."},"tenant":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Tenant. Token of a Tenant machine client or of a Tenant portal user, carrying the `tenantId` claim. Authorize one bearer scheme at a time."}},"schemas":{"CreateTenantUserRequest":{"type":"object","properties":{"userId":{"type":"string","description":"User unique ID"}},"required":["userId"]}}},"paths":{"/api/v1/tenant/users":{"post":{"description":"Creates an agent, along with a did:web, for a user","operationId":"TenantController_createUserByTenant_api/v1","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantUserRequest"}}}},"responses":{"201":{"description":"Holder identity provisioned with an Askar vault and a did:web identity"},"400":{"description":"Request validation failed (e.g. missing or malformed userId)"},"401":{"description":"Missing or invalid agents-realm service token"},"409":{"description":"The userId is already taken by an agent in this tenant (`user_id_taken_by_agent`), or it already has prior wallet activity but no did:web yet (`user_already_active`)"},"502":{"description":"Protocol API did:web registration failed for a reason other than an existing DID"}},"summary":"Create a wallet and did:web for user","tags":["Tenant"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.toolkit.equs.ai/api/web-wallet-api/tenant.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
