Add a Secret to a Property.
When you create a new secret, you will get an immediate response that contains information for that resource.
At the same time, a secret exchange task is triggered to test that the credential exchange is functional. This task is processed asynchronously and updates the secret’s status
attribute with one of two possible values:
succeeded
This is the status when the exchange request for the secret completes successfully.
failed
This is the status when the exchange request for the secret is not successful.
credentials
name
type_of
type_of
POST /properties/:property_id/secrets
curl https://reactor.adobe.io/properties/:property_id/secrets \
-H "Accept: application/vnd.api+json;revision=1" \
-H "Content-Type: application/vnd.api+json" \
-H "Authorization: Bearer [TOKEN]" \
-H "X-Api-Key: [KEY]" \
-H "X-Gw-Ims-Org-Id: [ORG_ID]" \
-X POST \
-d \
'
{
"data": {
"attributes": {
"name": "my oauth2-client_credentials secret",
"type_of": "oauth2-client_credentials",
"credentials": {
"client_id": "client_id",
"client_secret": "client_secret",
"token_url": "https://token.url"
}
},
"relationships": {
"environment": {
"data": {
"id": "ENc3b661c1a2c6413ab25fee036a6a4bc3",
"type": "environments"
}
}
},
"type": "secrets"
}
}'
{
"data": {
"id": "SEef272366e6ca44cd803704b2e225403e",
"type": "secrets",
"attributes": {
"created_at": "2023-04-21T23:07:57.457Z",
"updated_at": "2023-04-21T23:07:57.457Z",
"name": "my oauth2-client_credentials secret",
"type_of": "oauth2-client_credentials",
"activated_at": null,
"expires_at": null,
"refresh_at": null,
"status": "pending",
"created_by_email": "ciltaru@adobe.com",
"created_by_display_name": "George Ciltaru",
"updated_by_email": "ciltaru@adobe.com",
"updated_by_display_name": "George Ciltaru",
"credentials": {
"client_id": "client_id",
"token_url": "https://token.url",
"refresh_offset": 14400
}
},
"relationships": {
"property": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEef272366e6ca44cd803704b2e225403e/property"
},
"data": {
"id": "PRa8611a2d52e3462baa522b3925434a7a",
"type": "properties"
}
},
"environment": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEef272366e6ca44cd803704b2e225403e/environment"
},
"data": {
"id": "ENc3b661c1a2c6413ab25fee036a6a4bc3",
"type": "environments"
},
"meta": {
"stage": "development"
}
},
"notes": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEef272366e6ca44cd803704b2e225403e/notes"
}
},
"data_elements": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEef272366e6ca44cd803704b2e225403e/data_elements"
}
}
},
"links": {
"self": "https://reactor.adobe.io/secrets/SEef272366e6ca44cd803704b2e225403e",
"property": "https://reactor.adobe.io/secrets/SEef272366e6ca44cd803704b2e225403e/property"
}
}
}
type_of
POST /properties/:property_id/secrets
curl https://reactor.adobe.io/properties/:property_id/secrets \
-H "Accept: application/vnd.api+json;revision=1" \
-H "Content-Type: application/vnd.api+json" \
-H "Authorization: Bearer [TOKEN]" \
-H "X-Api-Key: [KEY]" \
-H "X-Gw-Ims-Org-Id: [ORG_ID]" \
-X POST \
-d \
'
{
"data": {
"attributes": {
"name": "my oauth2-jwt secret",
"type_of": "oauth2-jwt",
"credentials": {
"iss": "issuer",
"sub": "subject",
"aud": "audience",
"ttl": 86400,
"alg": "RS256",
"custom_claims": {
"claim1": "claim1 value"
},
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nprivatekey\n-----END RSA PRIVATE KEY-----",
"token_url": "https://token.url"
}
},
"relationships": {
"environment": {
"data": {
"id": "ENc2ca603ffe294ace8f2cab14ca47d67f",
"type": "environments"
}
}
},
"type": "secrets"
}
}'
{
"data": {
"id": "SE675ca9126ce34599ac0b62d94d59cb72",
"type": "secrets",
"attributes": {
"created_at": "2023-04-21T23:08:03.736Z",
"updated_at": "2023-04-21T23:08:03.736Z",
"name": "my oauth2-jwt secret",
"type_of": "oauth2-jwt",
"activated_at": null,
"expires_at": null,
"refresh_at": null,
"status": "pending",
"created_by_email": "ciltaru@adobe.com",
"created_by_display_name": "George Ciltaru",
"updated_by_email": "ciltaru@adobe.com",
"updated_by_display_name": "George Ciltaru",
"credentials": {
"iss": "issuer",
"sub": "subject",
"aud": "audience",
"ttl": 86400,
"alg": "RS256",
"custom_claims": {
"claim1": "claim1 value"
},
"token_url": "https://token.url",
"refresh_offset": 1800
}
},
"relationships": {
"property": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE675ca9126ce34599ac0b62d94d59cb72/property"
},
"data": {
"id": "PRcbd1737aafdd40b78a29e40bbd5f25ea",
"type": "properties"
}
},
"environment": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE675ca9126ce34599ac0b62d94d59cb72/environment"
},
"data": {
"id": "ENc2ca603ffe294ace8f2cab14ca47d67f",
"type": "environments"
},
"meta": {
"stage": "development"
}
},
"notes": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE675ca9126ce34599ac0b62d94d59cb72/notes"
}
},
"data_elements": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE675ca9126ce34599ac0b62d94d59cb72/data_elements"
}
}
},
"links": {
"self": "https://reactor.adobe.io/secrets/SE675ca9126ce34599ac0b62d94d59cb72",
"property": "https://reactor.adobe.io/secrets/SE675ca9126ce34599ac0b62d94d59cb72/property"
}
}
}
type_of
POST /properties/:property_id/secrets
curl https://reactor.adobe.io/properties/:property_id/secrets \
-H "Accept: application/vnd.api+json;revision=1" \
-H "Content-Type: application/vnd.api+json" \
-H "Authorization: Bearer [TOKEN]" \
-H "X-Api-Key: [KEY]" \
-H "X-Gw-Ims-Org-Id: [ORG_ID]" \
-X POST \
-d \
'
{
"data": {
"attributes": {
"name": "my oauth2-google secret",
"type_of": "oauth2-google",
"credentials": {
"scopes": [
"https://www.googleapis.com/auth/adwords",
"https://www.googleapis.com/auth/pubsub"
]
}
},
"relationships": {
"environment": {
"data": {
"id": "EN836d751a266b43d094ae4a8399a9a32f",
"type": "environments"
}
}
},
"type": "secrets"
}
}'
{
"data": {
"id": "SE36b03b87631048bd917f842bff7441d8",
"type": "secrets",
"attributes": {
"created_at": "2023-04-21T23:08:10.061Z",
"updated_at": "2023-04-21T23:08:10.061Z",
"name": "my oauth2-google secret",
"type_of": "oauth2-google",
"activated_at": null,
"expires_at": null,
"refresh_at": null,
"status": "manual_authorization_required",
"created_by_email": "ciltaru@adobe.com",
"created_by_display_name": "George Ciltaru",
"updated_by_email": "ciltaru@adobe.com",
"updated_by_display_name": "George Ciltaru",
"credentials": {
"scopes": [
"https://www.googleapis.com/auth/adwords",
"https://www.googleapis.com/auth/pubsub"
]
}
},
"relationships": {
"property": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE36b03b87631048bd917f842bff7441d8/property"
},
"data": {
"id": "PR26e94fe3cf324b8fbea90834d4adf354",
"type": "properties"
}
},
"environment": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE36b03b87631048bd917f842bff7441d8/environment"
},
"data": {
"id": "EN836d751a266b43d094ae4a8399a9a32f",
"type": "environments"
},
"meta": {
"stage": "development"
}
},
"notes": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE36b03b87631048bd917f842bff7441d8/notes"
}
},
"data_elements": {
"links": {
"related": "https://reactor.adobe.io/secrets/SE36b03b87631048bd917f842bff7441d8/data_elements"
}
}
},
"links": {
"self": "https://reactor.adobe.io/secrets/SE36b03b87631048bd917f842bff7441d8",
"property": "https://reactor.adobe.io/secrets/SE36b03b87631048bd917f842bff7441d8/property"
},
"meta": {
"authorization_url": "https://accounts.google.com/o/oauth2/auth?&client_id=434635668552-0qvlu519fdjtnkvk8hu8c8dj8rg3723r.apps.googleusercontent.com&...",
"authorization_url_expires_at": "2023-04-22T00:08:09.000Z"
}
}
}
type_of
POST /properties/:property_id/secrets
curl https://reactor.adobe.io/properties/:property_id/secrets \
-H "Accept: application/vnd.api+json;revision=1" \
-H "Content-Type: application/vnd.api+json" \
-H "Authorization: Bearer [TOKEN]" \
-H "X-Api-Key: [KEY]" \
-H "X-Gw-Ims-Org-Id: [ORG_ID]" \
-X POST \
-d \
'
{
"data": {
"attributes": {
"name": "my simple-http secret",
"type_of": "simple-http",
"credentials": {
"username": "username",
"password": "password"
}
},
"relationships": {
"environment": {
"data": {
"id": "EN8b0eec9808c94936898dbff5cb02ca66",
"type": "environments"
}
}
},
"type": "secrets"
}
}'
{
"data": {
"id": "SEc8fe5e7584b24a4f82fd805ce7ed74e3",
"type": "secrets",
"attributes": {
"created_at": "2023-04-21T23:07:50.950Z",
"updated_at": "2023-04-21T23:07:50.950Z",
"name": "my simple-http secret",
"type_of": "simple-http",
"activated_at": null,
"expires_at": null,
"refresh_at": null,
"status": "pending",
"created_by_email": "ciltaru@adobe.com",
"created_by_display_name": "George Ciltaru",
"updated_by_email": "ciltaru@adobe.com",
"updated_by_display_name": "George Ciltaru",
"credentials": {
"username": "username"
}
},
"relationships": {
"property": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc8fe5e7584b24a4f82fd805ce7ed74e3/property"
},
"data": {
"id": "PR84a35f631ec747f7b802b8cb2a8b1b29",
"type": "properties"
}
},
"environment": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc8fe5e7584b24a4f82fd805ce7ed74e3/environment"
},
"data": {
"id": "EN8b0eec9808c94936898dbff5cb02ca66",
"type": "environments"
},
"meta": {
"stage": "development"
}
},
"notes": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc8fe5e7584b24a4f82fd805ce7ed74e3/notes"
}
},
"data_elements": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc8fe5e7584b24a4f82fd805ce7ed74e3/data_elements"
}
}
},
"links": {
"self": "https://reactor.adobe.io/secrets/SEc8fe5e7584b24a4f82fd805ce7ed74e3",
"property": "https://reactor.adobe.io/secrets/SEc8fe5e7584b24a4f82fd805ce7ed74e3/property"
}
}
}
type_of
POST /properties/:property_id/secrets
curl https://reactor.adobe.io/properties/:property_id/secrets \
-H "Accept: application/vnd.api+json;revision=1" \
-H "Content-Type: application/vnd.api+json" \
-H "Authorization: Bearer [TOKEN]" \
-H "X-Api-Key: [KEY]" \
-H "X-Gw-Ims-Org-Id: [ORG_ID]" \
-X POST \
-d \
'
{
"data": {
"attributes": {
"name": "my secret",
"type_of": "token",
"credentials": {
"token": "my secret token"
}
},
"relationships": {
"environment": {
"data": {
"id": "EN8ad5f68088a74515824cf35976d1a0ac",
"type": "environments"
}
}
},
"type": "secrets"
}
}'
{
"data": {
"id": "SEc88b1da10a84432796a601ad7d9019ec",
"type": "secrets",
"attributes": {
"created_at": "2023-04-21T23:07:44.599Z",
"updated_at": "2023-04-21T23:07:44.599Z",
"name": "my secret",
"type_of": "token",
"activated_at": null,
"expires_at": null,
"refresh_at": null,
"status": "pending",
"created_by_email": "ciltaru@adobe.com",
"created_by_display_name": "George Ciltaru",
"updated_by_email": "ciltaru@adobe.com",
"updated_by_display_name": "George Ciltaru",
"credentials": {
}
},
"relationships": {
"property": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc88b1da10a84432796a601ad7d9019ec/property"
},
"data": {
"id": "PR28272c4381e14d639bd1d72e0f65f438",
"type": "properties"
}
},
"environment": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc88b1da10a84432796a601ad7d9019ec/environment"
},
"data": {
"id": "EN8ad5f68088a74515824cf35976d1a0ac",
"type": "environments"
},
"meta": {
"stage": "development"
}
},
"notes": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc88b1da10a84432796a601ad7d9019ec/notes"
}
},
"data_elements": {
"links": {
"related": "https://reactor.adobe.io/secrets/SEc88b1da10a84432796a601ad7d9019ec/data_elements"
}
}
},
"links": {
"self": "https://reactor.adobe.io/secrets/SEc88b1da10a84432796a601ad7d9019ec",
"property": "https://reactor.adobe.io/secrets/SEc88b1da10a84432796a601ad7d9019ec/property"
}
}
}