Bot Endpoint
POST /admin/projects/:projectId/bot
Creates a new Medplum Bot. Posting to this endpoint creates a Bot
resource and a corresponding ProjectMembership
resource.
Parameters
{
name: string;
description?: string;
accessPolicy?: Reference<AccessPolicy>;
}
Example request
- Typescript
- CLI
- cURL
await medplum.post('admin/projects/:projectId/bot', {
name: 'Hello World Bot',
description: 'Hello world',
accessPolicy: {
reference: 'AccessPolicy/access-policy-id',
},
});
medplum post admin/projects/:projectId/bot \
'{
"name": "Hello World Bot",
"description": "Hello world",
"accessPolicy": {
"reference": "AccessPolicy/access-policy-id"
}
}'
curl https://api.medplum.com/admin/projects/:projectId/bot \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Hello World Bot",
"description": "Hello world",
"accessPolicy": {
"reference": "AccessPolicy/:access-policy-id"
}'
Example Response
{
resourceType: 'Bot',
name: 'Hello World Bot',
description: 'Hello world',
runtimeVersion: 'awslambda',
sourceCode: {
contentType: 'text/typescript',
title: 'index.ts',
url: 'Binary/:uuid'
},
id: ':bot-uuid',
meta: {
project: ':projectId',
//...
},
}