Skip to content

Deployment Secrets

The Deployment Secrets resource provides access to all methods relating to Deployment Secrets in Keystash.

List Deployment Secrets

Path: /deployment-secrets/list

Method: GET

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional

Request Parameters

None.

Request Body

None.

Example Request

curl --location --request GET 'https://app.keystash.io/api/v1/deployment-secrets/list' \
--header 'Authorization: Bearer <token>'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "x0Uf09z3TYjoNVFv",
    "name": "Production Environment Keys",
    "description": "SSH keys for production deployment access",
    "secret": "kw9aKW0gixp5D-Ezos5Da5DPg9GPM9j6d4Te",
    "status": "enabled",
    "created": "2023-11-14 16:53:55",
    "modified": "2023-11-14 16:53:56",
    "created_by": "Max Smith",
    "created_user_id": "bkQV8I5BRcAVpg1d",
    "modified_by": "Anne Teak",
    "modified_user_id": "tr568I5BRcAVpwx7",
  },
  {
    "id": "p8CduXmyw6n9dzdd",
    "name": "Staging Environment Keys",
    "description": "SSH keys for staging deployment access",
    "secret": "VWB388vhkgEeivZbFVQgRXKf4sH32r0zjqqR",
    "enabled": "disabled",
    "created": "2023-11-15 09:22:33",
    "modified": "2023-11-15 09:22:34",
    "created_by": "Perry Scope",
    "created_user_id": "zwQV8I5BRcAVpgPr",
    "modified_by": "Perry Scope",
    "modified_user_id": "zwQV8I5BRcAVpgPr", 
  }
]

Example Error Response

HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "Forbidden",
    "message": "You do not have the required permission to access this path.",
    "details": [
      {
        "path": "/api/v1/deployment-secrets/list"
      }
    ]
  }
}

View Deployment Secret

Path: /deployment-secrets/view

Method: GET

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional

Request Parameters

Key Data Type Required Notes
id string required The ID of the deployment secret to view

Request Body

None.

Example Request

curl --location --request GET 'https://app.keystash.io/api/v1/deployment-secrets/view?id=x0Uf09z3TYjoNVFv' \
--header 'Authorization: Bearer <token>'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "x0Uf09z3TYjoNVFv",
  "name": "Production Environment Keys",
  "description": "SSH keys for production deployment access",
  "secret": "kw9aKW0gixp5D-Ezos5Da5DPg9GPM9j6d4Te",
  "status": "enabled",
  "created": "2023-11-14 16:53:55",
  "modified": "2023-11-14 16:53:56",
  "created_by": "Max Smith",
  "created_user_id": "bkQV8I5BRcAVpg1d",
  "modified_by": "Anne Teak",
  "modified_user_id": "tr568I5BRcAVpwx7",
}

Example Error Response

HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "NotFound",
    "message": "The Deployment Secret with the provided ID was not found.",
    "details": []
  }
}

Create Deployment Secret

Path: /deployment-secrets/create

Method: POST

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional
Content-Type application/json required

Request Parameters

None.

Request Body Parameters

Key Data Type Required Notes
name string required Name of the deployment secret
secret string required The secret that will be securely stored. This must be a 36 character string that can include numbers, a-z, A-Z and symbols.

Example Request Body

{
  "name": "Production Database Password",
  "secret": "Sup3rS3cur3P@ssw0rdF0rS3rv3rGroups!#"
}

Example Request

curl --location --request POST 'https://app.keystash.io/api/v1/deployment-secrets/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "name": "Production Database Password",
    "secret": "Sup3rS3cur3P@ssw0rdF0rS3rv3rGroups!#"
}'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Deployment Secret 'Production Database Password' was successfully created.",
  "id": "x0Uf09z3TYjoNVFv"
}

Example Error Response

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "BadArgument",
    "message": "Both name and secret are required fields.",
    "details": []
  }
}

Update Deployment Secret

Path: /deployment-secrets/update

Method: PATCH

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional
Content-Type application/json required

Request Parameters

None.

Request Body Parameters

Key Data Type Required Notes
id string required The ID of the deployment secret to update
name string required The new name for the deployment secret

Example Request Body

{
  "id": "x0Uf09z3TYjoNVFv",
  "name": "Updated Production Environment Keys"
}

Example Request

curl --location --request PATCH 'https://app.keystash.io/api/v1/deployment-secrets/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "id": "x0Uf09z3TYjoNVFv",
    "name": "Updated Production Environment Keys"
}'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Deployment Secret 'Updated Production Environment Keys' was successfully updated."
}

Example Error Response

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "BadArgument",
    "message": "The id field is required to update a Deployment Secret.",
    "details": []
  }
}

Enable Deployment Secret

Path: /deployment-secrets/enable

Method: PUT

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional

Request Parameters

Key Data Type Required Notes
id string required The ID of the deployment secret to enable

Request Body

None.

Example Request

curl --location --request PUT 'https://app.keystash.io/api/v1/deployment-secrets/enable?id=x0Uf09z3TYjoNVFv' \
--header 'Authorization: Bearer <token>'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Deployment Secret with ID 'x0Uf09z3TYjoNVFv' was successfully enabled."
}

Example Error Response

HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "NotFound",
    "message": "The Deployment Secret with the provided ID was not found.",
    "details": []
  }
}

Disable Deployment Secret

Path: /deployment-secrets/disable

Method: PUT

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional

Request Parameters

Key Data Type Required Notes
id string required The ID of the deployment secret to disable

Request Body

None.

Example Request

curl --location --request PUT 'https://app.keystash.io/api/v1/deployment-secrets/disable?id=x0Uf09z3TYjoNVFv' \
--header 'Authorization: Bearer <token>'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Deployment Secret with ID 'x0Uf09z3TYjoNVFv' was successfully disabled."
}

Example Error Response

HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "NotFound",
    "message": "The Deployment Secret with the provided ID was not found.",
    "details": []
  }
}

Delete Deployment Secret

Path: /deployment-secrets/delete

Method: DELETE

Authentication: Bearer Token

Request Headers

Key Value Required
Accept-Encoding gzip optional

Request Parameters

Key Data Type Required Notes
id string required The ID of the deployment secret to delete

Request Body

None.

Example Request

curl --location --request DELETE 'https://app.keystash.io/api/v1/deployment-secrets/delete?id=x0Uf09z3TYjoNVFv' \
--header 'Authorization: Bearer <token>'

Example Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "result": "Deployment Secret with ID 'x0Uf09z3TYjoNVFv' was successfully deleted."
}

Example Error Response

HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "NotFound",
    "message": "The Deployment Secret with the provided ID was not found.",
    "details": []
  }
}