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.

The board, source, and target must exist and form a valid connection.

Provide the label as valid Arcweave HTML content using <p>, <b>, or <code> tags.

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. Path-style localized label updates are supported.

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 incomplete endpoint pair.
403Project permission denied.
404Project or connection not found.
409Board, source, target, or connection is missing when the command is applied.