agent-swarm.devagent-swarm.dev

Users

Manage the user registry — create users, link cross-platform identities, mint tokens, merge duplicates, and triage unmapped senders

GET
/api/users

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

recentEvents?|
Range0 <= value <= 50

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/users"
{
  "users": [
    {
      "id": "string",
      "name": "string",
      "email": "string",
      "role": "string",
      "notes": "string",
      "emailAliases": [],
      "preferredChannel": "slack",
      "timezone": "string",
      "metadata": {
        "property1": null,
        "property2": null
      },
      "dailyBudgetUsd": 0,
      "status": "invited",
      "createdAt": "2019-08-24T14:15:22Z",
      "lastUpdatedAt": "2019-08-24T14:15:22Z",
      "identities": [
        {
          "kind": "string",
          "externalId": "string"
        }
      ],
      "tokens": [
        {
          "id": "string",
          "userId": "string",
          "label": "string",
          "tokenPreview": "string",
          "createdAt": "string",
          "lastUsedAt": "string",
          "revokedAt": "string"
        }
      ],
      "recentEvents": [
        {
          "id": "string",
          "userId": "string",
          "eventType": "string",
          "actor": "string",
          "before": null,
          "after": null,
          "createdAt": "string"
        }
      ]
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/users

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/users" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z",
    "identities": [
      {
        "kind": "string",
        "externalId": "string"
      }
    ],
    "tokens": [
      {
        "id": "string",
        "userId": "string",
        "label": "string",
        "tokenPreview": "string",
        "createdAt": "string",
        "lastUsedAt": "string",
        "revokedAt": "string"
      }
    ],
    "recentEvents": [
      {
        "id": "string",
        "userId": "string",
        "eventType": "string",
        "actor": "string",
        "before": null,
        "after": null,
        "createdAt": "string"
      }
    ]
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/users/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Query Parameters

recentEvents?|
Range0 <= value <= 200

Response Body

application/json

application/json

application/json

curl -X GET "http://localhost:3013/api/users/string"
{
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z",
    "identities": [
      {
        "kind": "string",
        "externalId": "string"
      }
    ],
    "tokens": [
      {
        "id": "string",
        "userId": "string",
        "label": "string",
        "tokenPreview": "string",
        "createdAt": "string",
        "lastUsedAt": "string",
        "revokedAt": "string"
      }
    ],
    "recentEvents": [
      {
        "id": "string",
        "userId": "string",
        "eventType": "string",
        "actor": "string",
        "before": null,
        "after": null,
        "createdAt": "string"
      }
    ]
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
PATCH
/api/users/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PATCH "http://localhost:3013/api/users/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z",
    "identities": [
      {
        "kind": "string",
        "externalId": "string"
      }
    ],
    "tokens": [
      {
        "id": "string",
        "userId": "string",
        "label": "string",
        "tokenPreview": "string",
        "createdAt": "string",
        "lastUsedAt": "string",
        "revokedAt": "string"
      }
    ],
    "recentEvents": [
      {
        "id": "string",
        "userId": "string",
        "eventType": "string",
        "actor": "string",
        "before": null,
        "after": null,
        "createdAt": "string"
      }
    ]
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/users/{id}/events

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Query Parameters

limit?integer
Range1 <= value <= 200
before?string

Response Body

application/json

application/json

application/json

curl -X GET "http://localhost:3013/api/users/string/events"
{
  "events": [
    {
      "id": "string",
      "userId": "string",
      "eventType": "string",
      "actor": "string",
      "before": null,
      "after": null,
      "createdAt": "string"
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/users/{id}/identities

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/users/string/identities" \  -H "Content-Type: application/json" \  -d '{    "kind": "string",    "externalId": "string"  }'
{
  "identities": [
    {
      "kind": "string",
      "externalId": "string"
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
DELETE
/api/users/{id}/identities/{kind}/{externalId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
kind*string
externalId*string

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:3013/api/users/string/identities/string/string"
{
  "identities": [
    {
      "kind": "string",
      "externalId": "string"
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/users/{id}/mcp-tokens

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/users/string/mcp-tokens" \  -H "Content-Type: application/json" \  -d '{}'
{
  "plaintext": "string",
  "token": {
    "id": "string",
    "userId": "string",
    "label": "string",
    "tokenPreview": "string",
    "createdAt": "string",
    "lastUsedAt": "string",
    "revokedAt": "string"
  },
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z",
    "identities": [
      {
        "kind": "string",
        "externalId": "string"
      }
    ],
    "tokens": [
      {
        "id": "string",
        "userId": "string",
        "label": "string",
        "tokenPreview": "string",
        "createdAt": "string",
        "lastUsedAt": "string",
        "revokedAt": "string"
      }
    ],
    "recentEvents": [
      {
        "id": "string",
        "userId": "string",
        "eventType": "string",
        "actor": "string",
        "before": null,
        "after": null,
        "createdAt": "string"
      }
    ]
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
DELETE
/api/users/{id}/mcp-tokens/{tokenId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
tokenId*string

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:3013/api/users/string/mcp-tokens/string"
{
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z",
    "identities": [
      {
        "kind": "string",
        "externalId": "string"
      }
    ],
    "tokens": [
      {
        "id": "string",
        "userId": "string",
        "label": "string",
        "tokenPreview": "string",
        "createdAt": "string",
        "lastUsedAt": "string",
        "revokedAt": "string"
      }
    ],
    "recentEvents": [
      {
        "id": "string",
        "userId": "string",
        "eventType": "string",
        "actor": "string",
        "before": null,
        "after": null,
        "createdAt": "string"
      }
    ]
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/users/{id}/merge

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/users/string/merge" \  -H "Content-Type: application/json" \  -d '{    "sourceUserId": "string"  }'
{
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z",
    "identities": [
      {
        "kind": "string",
        "externalId": "string"
      }
    ],
    "tokens": [
      {
        "id": "string",
        "userId": "string",
        "label": "string",
        "tokenPreview": "string",
        "createdAt": "string",
        "lastUsedAt": "string",
        "revokedAt": "string"
      }
    ],
    "recentEvents": [
      {
        "id": "string",
        "userId": "string",
        "eventType": "string",
        "actor": "string",
        "before": null,
        "after": null,
        "createdAt": "string"
      }
    ]
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/users/unmapped

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

kind?string
limit?integer
Range1 <= value <= 1000

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/users/unmapped"
{
  "unmapped": [
    {
      "kind": "string",
      "externalId": "string",
      "lastSeenAt": "string",
      "count": 0,
      "sampleEventType": "string",
      "sampleContext": null
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/users/unmapped/{kind}/{externalId}/resolve

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

kind*string
externalId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/users/unmapped/string/string/resolve" \  -H "Content-Type: application/json" \  -d '{    "userId": "string"  }'
{
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z",
    "identities": [
      {
        "kind": "string",
        "externalId": "string"
      }
    ],
    "tokens": [
      {
        "id": "string",
        "userId": "string",
        "label": "string",
        "tokenPreview": "string",
        "createdAt": "string",
        "lastUsedAt": "string",
        "revokedAt": "string"
      }
    ],
    "recentEvents": [
      {
        "id": "string",
        "userId": "string",
        "eventType": "string",
        "actor": "string",
        "before": null,
        "after": null,
        "createdAt": "string"
      }
    ]
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/whoami

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/whoami"
{
  "kind": "operator",
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "role": "string",
    "notes": "string",
    "emailAliases": [],
    "preferredChannel": "slack",
    "timezone": "string",
    "metadata": {
      "property1": null,
      "property2": null
    },
    "dailyBudgetUsd": 0,
    "status": "invited",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUpdatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}