# List methods

`opensend.methods.list(input?)`

Everything this API can do: each method with its route, its tool name, the scope it needs and a sample input.

Needs the scope: `methods:read`

## Input

- `namespace` (string): Only the methods of this group. One of: `emails`, `broadcasts`, `audiences`, `templates`, `automations`, `metrics`, `domains`, `apiKeys`, `webhooks`, `logs`, `workspace`, `members`, `methods`, `account`, `inbound`, `contacts`, `billing`, `ask`, `suppressions`, `runs`, `events`, `imports`, `topics`, `contactProperties`, `images`, `server`.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("list"): Always `list`.
- `data` (object[]): The items on this page.
- `data[].object` ("method"): Always `method`.
- `data[].name` (string): The name of the method, such as `emails.send`.
- `data[].namespace` (string): The group the method belongs to. One of: `emails`, `broadcasts`, `audiences`, `templates`, `automations`, `metrics`, `domains`, `apiKeys`, `webhooks`, `logs`, `workspace`, `members`, `methods`, `account`, `inbound`, `contacts`, `billing`, `ask`, `suppressions`, `runs`, `events`, `imports`, `topics`, `contactProperties`, `images`, `server`.
- `data[].call` (string): What the method does within its group. One of: `send`, `create`, `get`, `list`, `update`, `remove`, `verify`, `publish`, `pause`, `resume`, `invite`, `test`, `deliveries`, `plans`, `checkout`, `portal`, `close`, `invoices`, `batch`, `cancel`, `retry`, `chats`, `chat`, `save`, `forget`, `duplicate`, `enroll`, `versions`, `version`, `starters`, `starter`, `restore`, `inspect`, `render`, `edit`, `join`, `leave`, `add`, `upload`.
- `data[].kind` (string): `query` for a method that only reads, `mutation` for one that changes something. One of: `query`, `mutation`.
- `data[].title` (string): The method in a few words.
- `data[].description` (string): What the method does.
- `data[].ask` (string): A sentence a person could say to the assistant to have it use this method.
- `data[].effect` (string): What it does to your data: `read`, `write`, `send` or `destroy`. One of: `read`, `write`, `send`, `destroy`.
- `data[].scope` (string): The permission a key needs to call it. One of: `emails:send`, `emails:read`, `broadcasts:read`, `broadcasts:write`, `audiences:read`, `audiences:write`, `templates:read`, `templates:write`, `automations:read`, `automations:write`, `metrics:read`, `domains:read`, `domains:write`, `api_keys:read`, `api_keys:write`, `webhooks:read`, `webhooks:write`, `logs:read`, `workspace:read`, `workspace:write`, `methods:read`, `account:read`, `suppressions:read`, `suppressions:write`, `events:read`, `events:write`, `imports:read`, `imports:write`, `images:read`, `images:write`.
- `data[].http` (object): How to call it over HTTP.
- `data[].http.method` (string): The HTTP verb. One of: `GET`, `POST`, `PATCH`, `DELETE`.
- `data[].http.path` (string): The path, with `{id}` where an id goes.
- `data[].tool` (string): The name of the same method as an MCP tool.
- `data[].sample` (Record<string, unknown>): An input that works, to start from.
- `total` (integer): How many items match in all, on every page together.
- `hasMore` (boolean): Whether more items follow this page.

## Example

TypeScript:

```ts
await opensend.methods.list({
  namespace: 'account',
})
```

CLI:

```bash
opensend methods list --namespace account
```

Answer:

```json
{
  "object": "list",
  "data": [
    {
      "object": "method",
      "name": "account.get",
      "namespace": "account",
      "call": "get",
      "kind": "query",
      "title": "Retrieve account",
      "description": "Who is asking and every workspace they can open. For a person it also joins any workspace they were invited to.",
      "ask": "Which workspaces can I open?",
      "effect": "read",
      "scope": "account:read",
      "http": {
        "method": "GET",
        "path": "/v1/account"
      },
      "tool": "account_get",
      "sample": {}
    }
  ],
  "total": 1,
  "hasMore": false
}
```
