# Issue Credential — Dock Certs

> Issue a new credential. See the documentation

- Key: `dock_certs-issue-credential`
- Type: Action (Write)
- Version: 0.0.3
- App: Dock Certs (`dock_certs`) — https://pipedream.com/apps/dock-certs.md
- This page (HTML): https://pipedream.com/apps/dock-certs/actions/issue-credential
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/dock_certs/actions/issue-credential/issue-credential.mjs

## Description

Issue a new credential. [See the documentation](https://docs.api.dock.io/#credentials)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `issuerProfile` | `string` | Yes | Identifier of the profile issuing the credential Options are loaded from the connected account. |
| `anchor` | `boolean` | No | Whether to anchor the credential on the blockchain as soon as it is issued. Defaults to false. |
| `persist` | `boolean` | No | Whether to store an encrypted version of this credential with Dock Certs. Defaults to false, if true you must supply password. |
| `password` | `string` | No | Password used to encrypt the credential if you choose to store it. The same password must be used to retrieve the credential contents. Dock does not store this password. |
| `template` | `string` | No | The ID of the intended template/design Options are loaded from the connected account. |
| `type` | `string` | Yes | Credential type Options are loaded from the connected account. |
| `subject` | `string` | Yes | A unique identifier of the recipient. Example: DID, Email Address, National ID Number, Employee ID, Student ID, etc. |
| `status` | `string` | No | Identifier of the credential's revocation registry Options are loaded from the connected account. |
| `expirationDate` | `string` | No | The date and time in GMT that the credential expired is specified in RFC 3339 format. The default value of the expirationDate will be empty if the user does not provide it. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "dock_certs",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "dock_certs-issue-credential",
  arguments: {
    issuerProfile: "Issuer Profile",
    anchor: true,
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "dock_certs-issue-credential",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    dock_certs: { authProvisionId: "apn_xxxxxxx" },
    issuerProfile: "Issuer Profile",
    anchor: true,
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "dock_certs-issue-credential",
    "configured_props": {
      "dock_certs": { "authProvisionId": "apn_xxxxxxx" },
      "issuerProfile": "Issuer Profile",
      "anchor": true
    }
  }'
```

---

- App: https://pipedream.com/apps/dock-certs.md · All apps: https://pipedream.com/apps
