# Upload primary certificate

> PUT endpoint for uploading or updating the primary SAML certificate, requiring the PM.AuthSetting scope.

Upload or update the primary SAML certificate.

## API Endpoint

`PUT {accessURL}/{organizationName}/identity_/api/SamlCertificate/primary`

Replace `{accessURL}` in all endpoint paths with the base URL for your cloud platform:

| Cloud platform | Access URL |
| --- | --- |
| Automation Cloud | `https://cloud.uipath.com/` |
| Automation Cloud Public Sector | `https://govcloud.uipath.us/` |
| Automation Cloud Dedicated | `https://{customURL}.dedicated.uipath.com/` |

## Scopes

Requires the following scope: `PM.AuthSetting`.

## Request headers

```
--header 'Authorization: Bearer <your-access-token>'\
--header 'Content-Type: application/json'
```

:::note
To obtain the `<your-access-token>`, make sure to authenticate through one of the methods described [here](https://docs.uipath.com/automation-cloud/automation-cloud/latest/api-guide/authentication-methods#authentication-methods).
:::

## Request body

The request body contains the organization ID and the primary certificate you want to either upload or update.

```
{
  "partitionGlobalId": "<organizationId>",
  "certificate": "string"
}
```

## Responses

### 200 Success

The primary certificate is uploaded or updated.

```
{
  "partitionGlobalId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "primaryCertificateId": 0,
  "primaryCertificate": "string",
  "primaryCertificateThumbprint": "string",
  "secondaryCertificateId": 0,
  "secondaryCertificate": "string",
  "secondaryCertificateThumbprint": "string"
}
```
