---
title: "Add Credentials to Campaign"
method: POST
path: "/campaign/addCredentials"
tags: ["Campaign"]
---

# Add Credentials to Campaign

`POST /campaign/addCredentials`

Add the Credentials to the Campaigns. The request body allows you to add multiple Credentials to multiple Campaigns.

A Credential can be added without an email, but in this case when the credential is published, the recipient will not be notified via email.

If `quickPublish` is _true_ for a Credential, it will be directly published and sent to the Recipient. This field is widely used for not having to send a second request to publish the created Credentials. The Credential will be placed in a queue when published and the `certificateImageLink`, `badgeImageLink` and `verificationLink` fields in the response will start working once the Credential is out of the queue. They are returned in the response directly so that you can save them if needed.

`externalId` is used for linking the credential with a specific entity that is in your database. It is used when you want to receive all of the credentials which are linked to a specific entity. Any kind of identifier can be used, an example would be the id of an user in your database.

`attributes` are used when the Design or EmailTemplate has **custom** Attributes attached to them. The `id` of the Attributes can be received from the Attribute controller. Leave the list empty if no **custom** Attributes are used.

Details for the body of the request:

- `credentials` credentials list
  - `campaignId` id of the Campaign the Credential will be created in
  - `name` Recipient name
  - `email` Recipient email
  - `issueDate` issue date of credential, will be set to the time of request if omitted
  - `quickPublish` used for publishing the credential as soon as its created
  - `externalId` external id of the Credential
  - `attributes` list of attributes and the corresponding values for the Credential
    - `id` Attribute id
    - `value` Attribute value
  - `dontSendEmail` controls if an email notification should be sent to the recipient. No email will be sent if set to `true`, default is `false`

The response will be a dictionary which will have the different `campaignId` values sent in the request as keys, and the Credential list which was added to that Campaign as the value.

## Headers

- `api-version` string, required

## Request body

- AddCredentialsRequest
  - `credentials` CredentialInput[]
    - `campaignId` string
    - `name` string
    - `email` string
    - `issueDate` string, date — Issue date, defaults to time of request if omitted
    - `expireDate` string, date, nullable
    - `quickPublish` boolean — If true, credential is published immediately
    - `externalId` string, nullable
    - `attributes` AttributeValue[]
      - `id` string
      - `value` string
    - `dontSendEmail` boolean — If true, no email notification is sent. Default is false

## Response `200`

Successful response

- ApiResponse
  - `message` string, nullable
  - `hasError` boolean
  - `validationErrors` string[]
  - `data` unknown
  - `content` unknown

---

[API](https://skmtc.net/sertifier/apis/sertifier-credential-api-documentation.md) · [All operations](https://skmtc.net/sertifier/apis/sertifier-credential-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sertifier/sertifier-credential-api-documentation/revisions/98c494325aae/schema)
