POST
/
api
/
v1
/
external-functions
curl --request POST \
  --url https://api.play.ai/api/v1/external-functions \
  --header 'Authorization: Bearer <token>' \
  --header 'X-USER-ID: <api-key>' \
  --header 'content-type: <content-type>' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "endpointUrl": "<string>",
  "method": "GET",
  "parameters": [
    {
      "type": "number",
      "name": "<string>",
      "description": "<string>",
      "id": "<string>",
      "parameterPosition": "body"
    }
  ]
}'

Required parameters include the external function’s name and the external function’s description.

After you create your agent, you can attach the external function to an agent.

To update the external functions see the Update External Function endpoint.

Authorizations

Authorization
string
header
required

Your secret API key from PlayAI, formatted as Bearer YOUR_SECRET_API_KEY.

X-USER-ID
string
header
required

Your unique user ID from PlayAI.

Headers

content-type
enum<string>
required
Available options:
application/json
accept
enum<string>
Available options:
application/json

Body

application/json
name
any
required
description
any
required
endpointUrl
any
required
method
any
required
parameters
any

Response

201

External function created.