# Loops

### Creating a new loop

## Create loop

<mark style="color:green;">`POST`</mark> `https://b2b-api.loopcv.com/connect/loop`

This endpoint creates a Loop. You can pass as external id, an identification from your system.

#### Headers

| Name                                        | Type   | Description       |
| ------------------------------------------- | ------ | ----------------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String | Authorization Key |

#### Request Body

| Name                                       | Type    | Description                                                     |
| ------------------------------------------ | ------- | --------------------------------------------------------------- |
| title<mark style="color:red;">\*</mark>    | String  |                                                                 |
| location<mark style="color:red;">\*</mark> | String  | The format should be city, country. ex 'London, United Kingdom' |
| type<mark style="color:red;">\*</mark>     | String  | 'Full-time', 'Contract', 'Part-time', 'Temporary', 'Internship' |
| level<mark style="color:red;">\*</mark>    | String  | 'Junior', 'Associate', 'Senior'                                 |
| matchlevel                                 | Integer |                                                                 |
| keywords                                   | List    |                                                                 |
| externalId                                 | String  |                                                                 |
| scrapers                                   | List    | 'LinkedIn', 'Workable',...                                      |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "loopId": "3acc2305e14e5b8b0f5d587533852d66"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    "error" : "Description of the error"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity " %}

```javascript
{
 "errors": [{
   "location": "must have value"
 }]
}
```

{% endtab %}
{% endtabs %}

### Updating the loop

<mark style="color:orange;">`PUT`</mark> `https://b2b-api.loopcv.com/connect/loop/{loopId}`

This endpoint updates the Loop.

#### Path Parameters

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| loopId | String |             |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                       | Type    | Description                                                     |
| ------------------------------------------ | ------- | --------------------------------------------------------------- |
| title<mark style="color:red;">\*</mark>    | String  |                                                                 |
| location<mark style="color:red;">\*</mark> | String  |                                                                 |
| type<mark style="color:red;">\*</mark>     | String  | 'Full-time', 'Contract', 'Part-time', 'Temporary', 'Internship' |
| level<mark style="color:red;">\*</mark>    | String  | 'Junior', 'Associate', 'Senior'                                 |
| matchlevel                                 | Integer |                                                                 |
| keywords                                   | List    |                                                                 |
| scrapers                                   | List    |                                                                 |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "loopId": "3acc2305e14e5b8b0f5d587533852d66"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### Get loop

<mark style="color:blue;">`GET`</mark> `https://b2b-api.loopcv.com/connect/loop/{loopId}`

This endpoint returns the information of the Loop.

#### Path Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| loopId<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
	"loopId": "3acc2305e14e5b8b0f5d587533852d66",
	"title": "Software Engineer",
	"location": "Athens, Greece",
	"type": "Full-time",
	"level": "Senior",
	"keywords": [
		"python"
	]
}
```

{% endtab %}
{% endtabs %}

### Get loops

<mark style="color:blue;">`GET`</mark> `https://b2b-api.loopcv.com/connect/loops`

This endpoint returns your Loops.

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| X-API-KEY | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
[
	{
		"loopId": "3acc2305e14e5b8b0f5d587533852d66",
		"title": "Software Engineer",
		"location": "Athens, Greece",
		"type": "Full-time",
		"level": "Senior",
		"keywords": [
			"python"
		]
	},
	{
		"loopId": "538839102700680a5abaf3d7a1782c62",
		"title": "Senior Software Engineer",
		"location": "Athens, Greece",
		"type": "Full-time",
		"level": "Senior",
		"keywords": [
			"python"
		],
		"matchlevel": 50
	}
]
```

{% endtab %}
{% endtabs %}

### Deleting Loop

<mark style="color:red;">`DELETE`</mark> `https://b2b-api.loopcv.com/connect/loop/{loopId}`

This endpoint deletes the Loop.

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.loopcv.com/reference/api-reference/loops.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
