> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.awork.com/apiv1/custom-agents/post-connectors-by-connector-id-and-agent-id/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.awork.com/_mcp/server. # Links a connector to an agent. POST https://api.awork.com/api/v1/agents/{agentId}/connectors/{connectorId} Links an existing connector to the specified agent and returns the linked connector. Use [GET /agents/connectors](#/AgentRuntime/GetConnectors) to find a connector id. The user must have manage access to the agent. Reference: https://developers.awork.com/apiv1/custom-agents/post-connectors-by-connector-id-and-agent-id ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `agentId` (string, required) — The agent id. - `connectorId` (string, required) — The connector id. ## Response ### 200 OK - `id` (string, optional) — The id of the entity. - `createdOn` (string, optional) — The date this entity was created. - `createdBy` (string, optional) — The id of the user who created this entity. - `updatedOn` (string, optional) — The date this entity was last modified. - `updatedBy` (string, optional) — The id of the user who last modified this entity. - `ownerUserId` (string, optional, nullable) — The connector owner, or null for a preset without configuration. CreatedBy remains audit history. - `canDelete` (boolean, optional) — Whether the requesting user can delete the connector and all its connections. - `name` (string, optional, nullable) — The connector display name. - `description` (string, optional, nullable) — The connector description. - `url` (string, optional, nullable) — The custom connector URL. - `presetKey` (string, optional, nullable) — The predefined connector key. - `endpointValues` (list of ConnectorEndpointValueResponseModel, optional, nullable) — The safely displayable configured endpoint values. - `logoPath` (string, optional, nullable) — The preset logo path when this server matches a catalog preset. - `status` (string, optional, nullable) — The aggregate connection status. - `isSharedWithWorkspace` (boolean, optional) — Whether the connector is shared with the workspace. - `isOwner` (boolean, optional) — Whether the current user owns the connector. - `currentUserConnectionStatus` (string, optional, nullable) — The current user's connection status. - `lastRefreshedOn` (string, optional, nullable) — When the server tools were last refreshed. - `currentUserLastAuthenticatedOn` (string, optional, nullable) — When the current user last authenticated this server. - `hasOAuthClientConfiguration` (boolean, optional) — Whether static OAuth client credentials are configured. - `connectionMode` (string, optional, nullable) — The selected connection resolution mode for an agent-linked response. - `connectionId` (string, optional, nullable) — The selected specific connection, when applicable. - `currentUserConnectionId` (string, optional, nullable) — The connection selected by the current user for acting-user resolution. - `connections` (list of ConnectionResponseModel, optional, nullable) — The connections visible to the current user. ## Errors ### 401 Unauthorized Error Unauthorized - `code` (string, required) — The error code. - `description` (string, required) — The description of the error. - `link` (string, required) — The link to the API documentation page. - `details` (list of string, optional, nullable) — A list of details describing the error. - `validationErrors` (list of ValidationErrorResponse, optional, nullable) — If a validation error occurred, this contains the validation errors for each property. - `traceId` (string, optional, nullable) — The request trace id for tracking the request. ### 404 Not Found Error Not Found - `code` (string, required) — The error code. - `description` (string, required) — The description of the error. - `link` (string, required) — The link to the API documentation page. - `details` (list of string, optional, nullable) — A list of details describing the error. - `validationErrors` (list of ValidationErrorResponse, optional, nullable) — If a validation error occurred, this contains the validation errors for each property. - `traceId` (string, optional, nullable) — The request trace id for tracking the request. ## Types ### ConnectorEndpointValueResponseModel Represents one safely displayable configured connector endpoint value. - `key` (string, optional, nullable) — The stable endpoint field key. - `labelKey` (string, optional, nullable) — The frontend translation key used to label the field. - `value` (string, optional, nullable) — The configured non-secret field value. - `displayLabelKey` (string, optional, nullable) — The optional frontend translation key used instead of the raw value. ### ConnectionResponseModel Represents an authenticated identity for an MCP connector. - `canUse` (boolean, optional) — Whether normal ownership or sharing grants use of this connection and its owner is not suspended. Administrator status does not grant use. - `canDelete` (boolean, optional) — Whether the requesting user can delete this connection. - `isSuspended` (boolean, optional) — Whether this connection is suspended because its owner is inactive. - `id` (string, optional) — The connection identifier. - `connectorId` (string, optional) — The connector identifier. - `ownerUserId` (string, optional) — User identifier of the connection owner. - `name` (string, optional, nullable) — The connection display name. - `externalIdentity` (string, optional, nullable) — The external identity associated with the connection. - `status` (string, optional, nullable) — The human-readable connection status. - `isSharedWithWorkspace` (boolean, optional) — Whether the connection is shared with the complete workspace. - `isOwner` (boolean, optional) — Whether the current user owns the connection. - `lastAuthenticatedOn` (string, optional, nullable) — When the connection was last authorized. - `lastRefreshedOn` (string, optional, nullable) — When the connection's tools were last refreshed. ### ValidationErrorResponse The validation error response. - `property` (string, optional, nullable) — The name of the property that failed validation. - `message` (string, optional, nullable) — The reason why this property failed validation. ## Examples **Response** ```json { "id": "23e68187-91d6-4f7e-8d31-e3f2c60d7427", "createdOn": "2022-03-11T15:33:47.100Z", "createdBy": "9ad63972-4396-4b0b-9e7d-40b852cdebf8", "updatedOn": "2022-03-11T21:15:00.100Z", "updatedBy": "3d844c62-7410-4df9-a5b2-78805c0ee260", "ownerUserId": "9ad63972-4396-4b0b-9e7d-40b852cdebf8", "canDelete": true, "name": "Client CRM", "description": "HubSpot CRM for lead and client account research.", "url": null, "presetKey": "hubspot", "endpointValues": [ { "key": "region", "labelKey": "dataRegion", "value": "eu", "displayLabelKey": "eu" } ], "logoPath": "images/integrations/hubspot_icon.svg", "status": "connected", "isSharedWithWorkspace": true, "isOwner": true, "currentUserConnectionStatus": "connected", "lastRefreshedOn": "2026-08-29T08:05:00Z", "currentUserLastAuthenticatedOn": "2026-08-29T08:00:00Z", "hasOAuthClientConfiguration": true, "connectionMode": "actingUser", "connectionId": "af18602d-c8aa-4f63-a21e-5a7f59b2412c", "currentUserConnectionId": "af18602d-c8aa-4f63-a21e-5a7f59b2412c", "connections": [ { "canUse": true, "canDelete": true, "isSuspended": false, "id": "af18602d-c8aa-4f63-a21e-5a7f59b2412c", "connectorId": "7e376777-7834-4af6-9eb8-da065f568d30", "ownerUserId": "9ad63972-4396-4b0b-9e7d-40b852cdebf8", "name": "Client CRM connection", "externalIdentity": "account.manager@northstar.agency", "status": "connected", "isSharedWithWorkspace": true, "isOwner": true, "lastAuthenticatedOn": "2026-08-29T08:00:00Z", "lastRefreshedOn": "2026-08-29T08:05:00Z" } ] } ``` **SDK Code** ```python import requests url = "https://api.awork.com/api/v1/agents/agentId/connectors/connectorId" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.awork.com/api/v1/agents/agentId/connectors/connectorId'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.awork.com/api/v1/agents/agentId/connectors/connectorId" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.awork.com/api/v1/agents/agentId/connectors/connectorId") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.awork.com/api/v1/agents/agentId/connectors/connectorId") .header("Authorization", "Bearer ") .asString(); ``` ```php request('POST', 'https://api.awork.com/api/v1/agents/agentId/connectors/connectorId', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.awork.com/api/v1/agents/agentId/connectors/connectorId"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.awork.com/api/v1/agents/agentId/connectors/connectorId")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```