registerAgent.md
Register Agent
Register a new agent with Barndoor.
Agents represent AI applications that can access MCP servers through Barndoor. Each agent must be associated with an application directory (OAuth client configuration).
OpenAPI
POST /api/agents
openapi: 3.1.0
info:
title: Barndoor Platform API
version: 1.0.0
description: >
REST API for the Barndoor Platform - manage MCP servers, OAuth connections,
and proxy MCP requests.
## Authentication
All endpoints require a JWT Bearer token obtained through Barndoor's
OAuth 2.0 authorization-code flow with PKCE. The SDK handles the OAuth
flow automatically using interactive login.
## MCP Integration
The `/mcp/{mcp_server_name}` endpoints provide streaming proxy access to
third-party MCP servers
(Salesforce, Notion, Slack, etc.) with automatic authentication and session
management.
contact:
name: Barndoor Support
url: https://barndoor.ai
servers:
- url: https://{organization_id}.platform.barndoor.ai
description: Trial (Production)
variables:
organization_id:
description: Your organization identifier
default: your-org
- url: https://{organization_id}.platform.barndoor.ai
description: Enterprise (Production)
variables:
organization_id:
description: Your organization identifier
default: your-org
- url: https://{organization_id}.platform.barndooruat.com
description: Enterprise (Production)
variables:
organization_id:
description: Your organization identifier
default: your-org
- url: https://{organization_id}.platform.barndoordev.com
description: Enterprise (Production)
variables:
organization_id:
description: Your organization identifier
default: your-org
security:
- BearerAuth: []
tags:
- name: Servers
description: Manage MCP server instances
- name: Connections
description: Manage OAuth connections to MCP servers
- name: Policies
description: Manage access control policies for agents and servers
- name: Agents
description: Manage AI agent registrations
- name: MCP Proxy
description: Proxy requests to MCP servers
- name: Identity
description: Retrieve identity information for the authenticated user
paths:
/api/agents:
post:
tags:
- Agents
summary: Register Agent
description: >
Register a new agent with Barndoor.
Agents represent AI applications that can access MCP servers through
Barndoor.
Each agent must be associated with an application directory (OAuth
client configuration).
operationId: registerAgent
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AgentPayload'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Agent'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
AgentPayload:
properties:
application_directory_id:
type: string
title: Agent Directory Id
type: object
required:
- application_directory_id
title: AgentPayload
Agent:
properties:
id:
type: string
format: uuid
title: Id
created_at:
type: string
format: date-time
title: Created At
updated_at:
type: string
format: date-time
title: Updated At
organization_id:
type: string
format: uuid
title: Organization Id
application_directory_id:
type: string
format: uuid
title: Agent Directory Id
type: object
required:
- id
- created_at
- updated_at
- organization_id
- application_directory_id
title: Agent
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: >
JWT token obtained through Barndoor's OAuth 2.0 authorization-code
flow with PKCE.
The token should be included in the Authorization header:
`Authorization: Bearer <your-jwt-token>`
Use the Barndoor SDK's `loginInteractive()` function to obtain tokens
automatically.