Client Application Endpoint
POST /admin/projects/:projectId/client
Creates a new ClientApplication. Posting to this endpoint creates a ClientApplication
resource and a corresponding ProjectMembership
resource.
Parameters
{
name: string;
description?: string;
redirectUri?: string;
accessPolicy?: Reference<AccessPolicy>;
identityProvider?: {
authorizeUrl?: string;
tokenUrl?: string;
userInfoUrl?: string;
clientId?: string;
clientSecret?: string;
useSubject?: boolean;
}
}
Example request
- Typescript
- CLI
- cURL
await medplum.post('admin/projects/:projectId/client', {
name: 'Hello World Client',
description: 'Client App for Medplum Hello World',
redirectUri: 'https://example.com/redirect',
accessPolicy: {
reference: 'AccessPolicy/access-policy-id',
},
});
medplum post admin/projects/:projectId/client \
'{
"name": "Hello World Client",
"description": "Client App for Medplum Hello World",
"redirectUri": "https://example.com/redirect"
"accessPolicy": {
"reference": "AccessPolicy/access-policy-id"
}
}'
curl https://api.medplum.com/admin/projects/:projectId/client \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Hello World Client",
"description": "Hello world",
"redirectUri": "https://example.com/redirect"
"accessPolicy": {
"reference": "AccessPolicy/:access-policy-id"
}'
Example Response
{
meta: {
project: ':projectId',
//...
},
resourceType: 'ClientApplication',
name: 'Hello World Client',
id: ':clientId',
secret: ':clientSecret',
description: 'Client App for Medplum Hello World',
redirectUri: 'https://example.com/redirect'
}