Skip to content

Connections ​

Connection endpoints create, retrieve, update, and delete connections between board items.

Endpoints ​

Create connection # POST/api/v1/{hash}/connection

Request

http
POST /api/v1/{hash}/connection
bash
curl --request POST \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data @payload.json \
  "https://arcweave.com/api/v1/PROJECT_HASH/connection"
json
{
  "boardId": "b1",
  "sourceid": "e2",
  "sourceType": "elements",
  "targetid": "e1",
  "targetType": "elements",
  "label": "<p>Continue</p>",
  "labelLocation": 0.25,
  "labelWidth": 180,
  "theme": "default",
  "type": "Bezier"
}

Request fields:

PropertyRequiredTypeDescription
boardIdYesStringBoard containing the connection.
sourceidYesStringSource item ID.
sourceTypeYesStringelements or conditions.
targetidYesStringTarget item ID.
targetTypeYesStringelements, branches, or jumpers.
labelNoString, null, or localized mapConnection label. Defaults to no label.
labelLocationNoNumberRelative label position from 0 to 1. Defaults to 0.5.
labelWidthNoNumberPositive label width.
sourceFaceNoString or nullleft, right, top, or bottom. Omit or use null to leave the face unset.
targetFaceNoString or nullleft, right, top, or bottom. Omit or use null to leave the face unset.
themeNoStringOne of the color themes. Defaults to default.
typeNoStringStraight, Bezier, or Flowchart (case-sensitive). Defaults to Bezier.

boardId must identify a regular board, not a folder. The source and target must exist on that board; a condition belongs to the board that contains its branch. A condition has a single output connection: if it already has one, delete that connection or update its target instead of creating another connection from the condition.

Provide label as valid rich text HTML. Labels support Arcscript code blocks, but not blockquotes or inline code. Code blocks must contain valid Arcscript, and the variables, variable attributes, and elements they reference must exist. Otherwise, the request returns 400 Bad Request with the title Bad Request - invalid Arcscript and an error for each invalid label path.

A string or null updates only the project's main language. Locale maps update only the supplied, already configured languages; see Localized content for examples and error handling.

Response

Returns 201 Created with the generated resource ID and project version data:

json
{
  "version": 12,
  "newVersion": 13,
  "versionTime": ["1720788000", "123456"],
  "id": "65139ea3-331f-4b25-88b4-ea7a65ff106c"
}

Get connection # GET/api/v1/{hash}/connection/{connectionID}

Request

http
GET /api/v1/{hash}/connection/{connectionID}
bash
curl --request GET \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Accept: application/json" \
  "https://arcweave.com/api/v1/PROJECT_HASH/connection/{connectionID}"

Response

Returns 200 OK.

json
{
  "id": "con2",
  "boardId": "b1",
  "sourceid": "e2",
  "targetid": "e1",
  "sourceType": "elements",
  "targetType": "elements",
  "theme": "default",
  "type": "Bezier",
  "label": {
    "en": {
      "text": "<p>Test label</p><pre><code>custom_b1.board_var_9 == 0</code></pre>"
    }
  }
}

boardId is derived from the board that contains the connection.

Update connection # PATCH/api/v1/{hash}/connection/{connectionID}

Request

http
PATCH /api/v1/{hash}/connection/{connectionID}
bash
curl --request PATCH \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data @payload.json \
  "https://arcweave.com/api/v1/PROJECT_HASH/connection/{connectionID}"
json
{
  "label": {
    "en": {
      "text": "<p>Updated label</p>"
    }
  },
  "labelLocation": 0.75,
  "labelWidth": 180,
  "theme": "blue",
  "type": "Straight",
  "targetid": "e3",
  "targetType": "elements",
  "sourceFace": "left",
  "targetFace": "right"
}

Request fields:

PropertyRequiredTypeDescription
labelNoString, null, or localized mapUpdated label. If omitted, the current value is retained.
labelLocationNoNumberRelative label position from 0 to 1. Omit to keep the current value.
labelWidthNoNumber or nullPositive label width. Use null to remove the stored width.
themeNoStringOne of the color themes. Omit to keep the current theme.
typeNoStringStraight, Bezier, or Flowchart (case-sensitive). Omit to keep the current type.
sourceidNoStringNew source item ID. Must be sent together with sourceType.
sourceTypeNoStringNew source type: elements or conditions.
targetidNoStringNew target item ID. Must be sent together with targetType.
targetTypeNoStringNew target type: elements, branches, or jumpers.
sourceFaceNoString or nullleft, right, top, or bottom. Use null to clear; omit to retain.
targetFaceNoString or nullleft, right, top, or bottom. Use null to clear; omit to retain.

When changing an endpoint, send its ID and type as a pair. The new source and target must exist on the connection's board and form a valid connection. A condition cannot become the source when it already owns another output connection.

The update must include at least one supported field. The label formatting rules and Arcscript validation also apply to updates.

A string or null updates only the project's main language; locale maps update only the supplied, already configured languages. Path-style fields such as label/fr/text are also supported. See Localized content for examples and error handling.

Response

Returns 200 OK with project version data:

json
{
  "version": 12,
  "newVersion": 13,
  "versionTime": ["1720788000", "123456"]
}

Delete connection # DELETE/api/v1/{hash}/connection/{connectionID}

Request

http
DELETE /api/v1/{hash}/connection/{connectionID}
bash
curl --request DELETE \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Accept: application/json" \
  "https://arcweave.com/api/v1/PROJECT_HASH/connection/{connectionID}"

Response

Returns 200 OK with project version data:

json
{
  "version": 12,
  "newVersion": 13,
  "versionTime": ["1720788000", "123456"]
}

Common errors ​

StatusMeaning
400Invalid fields, enum, numeric value, label content or Arcscript, incomplete endpoint pair, or a folder boardId.
403Project permission denied.
404Project or connection not found.
409An unknown locale was supplied; the board, source, target, or connection is missing, or an endpoint is on another board; an update would give a condition a second output; or the project changed during Arcscript validation.