Skip to Content
Credentials

Add a Credential to the given organization

POST
/organizations/{organization_id}/credentials

Path Parameters

organization_id*string

The numeric ID or URL Slug of an organization.

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Request Body

A JSON object containing the resource data

application/json
  1. body
name*string

The name of the credential. Must not be greater than 60 characters.

provider_code*ProviderCode

The code of the service provider.

Value in"aws""azure""bitbucket""digitalocean""gcp""github""gitlab""hetzner"
provider_type*ProviderType

The possible types of providers.

Value in"cloud_provider""source_provider"
active*boolean

If this credential is active or not.

settings*

Response Body

Created

application/json
  1. response
id*integer

The unique ID of the credential

name*string

The name of the credential

provider*
provider_type*string

The type of the credential

provider_type_human_readable*string

The human readable version of the type of the credential

provider_auth_type*string

The authentication type of the credential

provider_auth_type_human_readable*string

The human readable version of the authentication type

active*boolean

If this credential is active or not

organization?|null
created_by_user*|null
last_action?|null
created_at*string

The date and time when the record was created

updated_at*string

The date and time when the record was last updated

Example Request
curl -X POST 'https://api.devopness.com/organizations/johndoe/credentials' \  -H 'Accept: application/json' \  -H 'Authorization: Bearer <your_api_token>' \  -H 'Content-Type: application/json' \  -H 'Content-Type: application/json' \  -d '{  "name": "My cool credential",  "provider_code": "aws",  "provider_type": "cloud_provider",  "active": false,  "settings": {    "credential": {      "access_key_id": "3dlxAUgbuTJY0AitQMAFHd6JadVRw3rGml",      "secret_access_key": "my-secret"    }  }}'
Example Response
{  "id": 85324,  "name": "My cool credential",  "provider": {    "active": true,    "code": "aws",    "code_human_readable": "Amazon Web Services",    "type": "cloud_provider",    "type_human_readable": "Cloud Provider"  },  "provider_type": "cloud_provider",  "provider_type_human_readable": "Cloud Provider",  "provider_auth_type": "api_credentials",  "provider_auth_type_human_readable": "API Credentials",  "active": true,  "organization": {    "id": 16523,    "name": "My Organization",    "url_slug": "MyOrganization",    "resource_summary": [      {        "resource_type": "environment",        "resource_type_plural": "environments",        "resource_type_human_readable": "Environment",        "resource_type_human_readable_plural": "Environments",        "summary": {          "count": 1        }      }    ],    "owner": {      "id": 1,      "name": "string",      "email": "user@example.com",      "url_slug": "someone",      "language": "en",      "active": true,      "created_at": "2019-09-25T15:50:48.000000Z",      "updated_at": "2019-09-25T13:52:04.000000Z"    },    "created_at": "2019-09-25T15:50:48.000000Z",    "updated_at": "2019-09-25T13:52:04.000000Z"  },  "created_by_user": {    "id": 1,    "name": "string",    "email": "user@example.com",    "url_slug": "someone",    "language": "en",    "active": true,    "created_at": "2019-09-25T15:50:48.000000Z",    "updated_at": "2019-09-25T13:52:04.000000Z"  },  "last_action": {    "id": 567819876,    "status": "in-progress",    "status_human_readable": "Pending",    "status_reason_code": "PENDING",    "status_reason_human_readable": "Pending: Action created successfully but has not yet been queued for execution.",    "type": "deploy",    "type_human_readable": "Deploy",    "url_web_permalink": "https://devopness.com/actions/567819876",    "action_data": {      "release_name": "2022-07-05-13-25-38",      "commit": {        "repository": "devopness/example",        "author_name": "Author Name",        "author_email": "email@example.com",        "committed_at": "2019-09-25T15:50:48.000000Z",        "hash": "d433e4622fde4b59a48586ed94082e2d76e855c1",        "message": "fix: some bug",        "url": "https://source-provider.com/commit/d433e4622fde4b59a48586ed94082e2d76e855c1",        "clone_url": "https://source-provider.com/commit/d433e4622fde4b59a48586ed94082e2d76e855c1.git",        "download_url": "https://source-provider.com/commit/d433e4622fde4b59a48586ed94082e2d76e855c1.tar.gz"      },      "deployment": {        "type": "deploy",        "source_type": "branch",        "source_ref": "develop",        "repository": "devopness/example",        "provider_name": "github",        "pipeline_id": 23439      }    },    "triggered_from": {      "origin": "https://devopness.com",      "trigger_type": "manual",      "name": "User Name",      "email": "user@example.com",      "ip_address": "172.17.0.9",      "user_id": 794613284672,      "hook_id": "28623d9b-0f34-48d7-b5ab-9ed281dc5a6c",      "hook_request_id": "0369a338-10f0-48d0-aa2d-80d1ce14e91e"    },    "summary": {      "targets": {        "count": 4,        "pending": 2,        "in_progress": 1,        "completed": 1,        "failed": 0      }    },    "targets": [      {        "id": 1234,        "resource_type": "server",        "resource_type_human_readable": "Server",        "resource_id": 4567890,        "status": "in-progress",        "status_human_readable": "Pending",        "status_reason_code": "PENDING",        "status_reason_human_readable": "Pending: Target created successfully but has not yet been queued for execution. It will be added to an execution queue once their dependencies are resolved.",        "total_steps": 5,        "current_step": {          "id": 18931,          "action_id": 98412,          "action_target_id": 65712,          "name": "Setting up cron job",          "description": "Setting up cron job for daily execution at 00:00",          "order": 3,          "status": "in-progress",          "status_human_readable": "Pending",          "status_reason_code": "PENDING",          "status_reason_human_readable": "Pending: Step created successfully but has not yet been queued for execution. It will be added to an execution queue once their dependencies are resolved.",          "started_at": "2019-09-25T15:50:48.000000Z",          "completed_at": "2019-09-25T13:52:04.000000Z",          "created_at": "2019-09-25T15:50:48.000000Z",          "updated_at": "2019-09-25T13:52:04.000000Z"        },        "steps": [          {            "id": 18931,            "action_id": 98412,            "action_target_id": 65712,            "name": "Setting up cron job",            "description": "Setting up cron job for daily execution at 00:00",            "order": 3,            "status": "in-progress",            "status_human_readable": "Pending",            "status_reason_code": "PENDING",            "status_reason_human_readable": "Pending: Step created successfully but has not yet been queued for execution. It will be added to an execution queue once their dependencies are resolved.",            "started_at": "2019-09-25T15:50:48.000000Z",            "completed_at": "2019-09-25T13:52:04.000000Z",            "created_at": "2019-09-25T15:50:48.000000Z",            "updated_at": "2019-09-25T13:52:04.000000Z"          }        ],        "resource_data": {          "id": 4425,          "name": "my-credential",          "provider_type": "cloud_provider",          "provider_code": "aws",          "provider_name": "aws",          "provider_name_human_readable": "Amazon Web Services"        },        "started_at": "2019-09-25T15:50:48.000000Z",        "completed_at": "2019-09-25T13:52:04.000000Z",        "created_at": "2019-09-25T15:50:48.000000Z",        "updated_at": "2019-09-25T13:52:04.000000Z"      }    ],    "started_at": "2019-08-24T14:15:22Z",    "completed_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  },  "created_at": "2019-09-25T15:50:48.000000Z",  "updated_at": "2019-09-25T15:50:48.000000Z"}