---
title: "Create Agent Resource"
method: POST
path: "/voice/agent-resources"
tags: ["Voice Agent Intelligence"]
---

# Create Agent Resource

`POST /voice/agent-resources`

## Request

- Base URL: `https://api.speakai.co/v1`
- URL: `https://api.speakai.co/v1/voice/agent-resources`
- Auth: API key in header `x-speakai-key` and API key in header `x-access-token`

### Create Agent Resource

Requires the OWNER or ADMIN role. Adds one document/link to an agent's knowledge base; the server fetches and embeds the content in the background (status moves from pending to completed).

## Request body

- object
  - `agentId` string, required: Required.
  - `url` string, uri, required: Required.
  - `title` string, required: Required. Max 200 characters.
  - `description` string, required: Required. Max 1000 characters.
  - `action` 'link' | 'presentation', required: Required.
  - `contentType` 'video' | 'pdf' | 'image'

## Response `201`

Created

- object
  - `status` 'success'
  - `data` object
    - `resource` object
      - `_id` string: MongoDB document id, included because every document has one; use resourceId to identify it.
      - `resourceId` string: Server-generated UUID. Immutable -- sent in the body on create or update is silently dropped.
      - `agentId` string: Required on create. Immutable after create -- sent on update is silently dropped.
      - `companyId` string: Stamped from the caller's authenticated company. Sent in the body is silently dropped.
      - `userId` string: Id of the user who created this resource. Sent in the body is silently dropped.
      - `url` string, uri: Required on create.
      - `title` string: Required on create. Max 200 characters.
      - `description` string: Required on create. Max 1000 characters.
      - `action` 'link' | 'presentation': Required on create.
      - `contentType` 'video' | 'pdf' | 'image'
      - `status` 'pending' | 'uploading' | 'processing' | 'completed' | 'failed': Defaults to pending. Advances as the resource's content is fetched and embedded for the agent to search during calls. Not settable directly.
      - `isDeleted` boolean: Delete is a soft delete. Not settable directly.
      - `deletedAt` string, date-time, nullable
      - `createdAt` string, date-time
      - `updatedAt` string, date-time

## Other responses

- `400`: Validation failed
- `403`: Caller's role is not OWNER or ADMIN
- `404`: Agent not found

---

[API](https://skmtc.dev/speakai/apis/speak-ai-api.md) · [All operations](https://skmtc.dev/speakai/apis/speak-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/speakai/apis/speak-ai-api/revisions/52d777e6d46e?raw)
