## POST `/admin/projects/:projectId/client`

Creates a new [ClientApplication](/content/docs/api/fhir/medplum/clientapplication/index.html). Posting to this endpoint creates a [`ClientApplication`](/content/docs/api/fhir/medplum/clientapplication/index.html) resource and a corresponding [`ProjectMembership`](/content/docs/api/fhir/medplum/projectmembership/index.html) resource.

### Parameters

```ts
{
  name: string;
  description?: string;
  redirectUri?: string;
  accessPolicy?: Reference<AccessPolicy>;
  identityProvider?: {
    authorizeUrl?: string;
    tokenUrl?: string;
    userInfoUrl?: string;
    clientId?: string;
    clientSecret?: string;
    useSubject?: boolean;
  }
}
```

### Example request

```ts
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',
  },
});
```

```bash
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"
  }
}'
```

```bash
curl https://api.medplum.com/admin/projects/:projectId/client \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Hello World Client",
  "description": "Client App for Medplum Hello World",
  "redirectUri": "https://example.com/redirect",
  "accessPolicy": {
    "reference": "AccessPolicy/:access-policy-id"
  }
}'
```

### Example Response

```ts
{
  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'
}
```
