Update an agent
client.agents.update(stringid, AgentUpdateParams { metadata, spec, updateMask } body, RequestOptionsoptions?): Agent { metadata, spec, info }
PATCH/v1/agents/{id}
Update an agent
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const agent = await client.agents.update('id');
console.log(agent.metadata);{
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"status": "AGENT_STATUS_UNSPECIFIED",
"variationSelectionMode": "VARIATION_SELECTION_MODE_UNSPECIFIED",
"description": "description",
"webhookEventsUrl": "webhookEventsUrl"
},
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_USER",
"email": "email",
"name": "name"
}
},
"variationCount": 0
}
}Returns Examples
{
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"status": "AGENT_STATUS_UNSPECIFIED",
"variationSelectionMode": "VARIATION_SELECTION_MODE_UNSPECIFIED",
"description": "description",
"webhookEventsUrl": "webhookEventsUrl"
},
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_USER",
"email": "email",
"name": "name"
}
},
"variationCount": 0
}
}