---
title: "Create a new Credential"
method: POST
path: "/api/v1/credentials"
tags: ["Credentials"]
---

# Create a new Credential

`POST /api/v1/credentials`

Creates a credential scoped to your organization.

## Request body

- Credential
  - `credential_type` union, required — Universal credential type — tagged enum stored as JSONB. Each variant represents a different credential protocol/method.
    - object — SNMPv2c community string for querying network devices
      - `community` union, required — Secret value that can be either inline content or a file path on the daemon host.
        - object
          - `mode` 'Inline', required
          - `value` string, required
        - object
          - `mode` 'FilePath', required
          - `path` string, required
      - `type` 'SnmpV2c', required
    - object — Docker API proxy credentials. Target IP determined from host ip_addresses at scan time.
      - `path` string, nullable — Optional URL path prefix (e.g. "/v1.43")
      - `port` integer — Port for the Docker API proxy (default 2375)
      - `ssl_cert` union — Non-secret value that can be inline content or a file path on daemon host.
        - object
          - `mode` 'Inline', required
          - `value` string, required
        - object
          - `mode` 'FilePath', required
          - `path` string, required
      - `ssl_chain` union — Non-secret value that can be inline content or a file path on daemon host.
        - object
          - `mode` 'Inline', required
          - `value` string, required
        - object
          - `mode` 'FilePath', required
          - `path` string, required
      - `ssl_key` union — Secret value that can be either inline content or a file path on the daemon host.
        - object
          - `mode` 'Inline', required
          - `value` string, required
        - object
          - `mode` 'FilePath', required
          - `path` string, required
      - `type` 'DockerProxy', required
    - object — Local Docker socket access. Auto-injected by daemon when socket is available. Not user-selectable — managed automatically from daemon capabilities.
      - `type` 'DockerSocket', required
  - `name` string, required
  - `organization_id` string, uuid, required
  - `tags` string[], required
  - `target_ips` string[], nullable — Ephemeral bootstrap IPs for pre-discovery credential resolution. Cleared automatically when the next scan dispatches.
  - `created_at` string, date-time, required
  - `id` string, uuid, required
  - `updated_at` string, date-time, required

## Response `200`

Credential created successfully

- ApiResponseCredential
  - `data` object
    - `credential_type` union, required — Universal credential type — tagged enum stored as JSONB. Each variant represents a different credential protocol/method.
      - object — SNMPv2c community string for querying network devices
        - `community` union, required — Secret value that can be either inline content or a file path on the daemon host.
          - object
            - `mode` 'Inline', required
            - `value` string, required
          - object
            - `mode` 'FilePath', required
            - `path` string, required
        - `type` 'SnmpV2c', required
      - object — Docker API proxy credentials. Target IP determined from host ip_addresses at scan time.
        - `path` string, nullable — Optional URL path prefix (e.g. "/v1.43")
        - `port` integer — Port for the Docker API proxy (default 2375)
        - `ssl_cert` union — Non-secret value that can be inline content or a file path on daemon host.
          - object
            - `mode` 'Inline', required
            - `value` string, required
          - object
            - `mode` 'FilePath', required
            - `path` string, required
        - `ssl_chain` union — Non-secret value that can be inline content or a file path on daemon host.
          - object
            - `mode` 'Inline', required
            - `value` string, required
          - object
            - `mode` 'FilePath', required
            - `path` string, required
        - `ssl_key` union — Secret value that can be either inline content or a file path on the daemon host.
          - object
            - `mode` 'Inline', required
            - `value` string, required
          - object
            - `mode` 'FilePath', required
            - `path` string, required
        - `type` 'DockerProxy', required
      - object — Local Docker socket access. Auto-injected by daemon when socket is available. Not user-selectable — managed automatically from daemon capabilities.
        - `type` 'DockerSocket', required
    - `name` string, required
    - `organization_id` string, uuid, required
    - `tags` string[], required
    - `target_ips` string[], nullable — Ephemeral bootstrap IPs for pre-discovery credential resolution. Cleared automatically when the next scan dispatches.
    - `created_at` string, date-time, required
    - `id` string, uuid, required
    - `updated_at` string, date-time, required
  - `error` string, nullable
  - `meta` ApiMeta, required — API metadata included in all responses
    - `api_version` integer, required — API version (integer, increments on breaking changes)
    - `server_version` string, required — Server version (semver)
  - `success` boolean, required

## Other responses

- `400` — Validation error

## Changes

- **2026-04-20** `f04499e2280f` — 4 breaking, 2 warning, 4 info
  - removed `subschema #1, subschema #3, subschema #5, subschema #6, subschema #7` from the `allOf[#/components/schemas/CredentialBase]/credential_type` request property `oneOf` list
  - added `subschema #3` to the `data/allOf[#/components/schemas/CredentialBase]/credential_type` response property `oneOf` list for the response status `200`
  - removed the required property `data/allOf[#/components/schemas/CredentialBase]/assigned_network_ids` from the response with the `200` status
  - removed the required property `data/allOf[#/components/schemas/CredentialBase]/host_assignments` from the response with the `200` status
  - …6 more

[Change history](https://skmtc.dev/scanopy/apis/scanopy-api/changes/api/v1/credentials/post.md)

---

[API](https://skmtc.dev/scanopy/apis/scanopy-api.md) · [All operations](https://skmtc.dev/scanopy/apis/scanopy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scanopy/scanopy-api/revisions/f04499e2280f/schema)
