---
title: Creating an indexing pipeline extension with the API
slug: '146'
canonical_url: https://docs.coveo.com/en/146/
collection: index-content
source_format: adoc
---
# Creating an indexing pipeline extension with the API

The following procedure describes how to create an [indexing pipeline extension (IPE)](https://docs.coveo.com/en/206.md) for a [Coveo organization](https://docs.coveo.com/en/185.md) using the [Extension API](https://docs.coveo.com/en/7.md).

On the [Coveo Administration Console](https://docs.coveo.com/en/183.md) [**API Keys**](https://platform.cloud.coveo.com/admin/#/orgid/organization/api-access/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/organization/api-access/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/organization/api-access/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/organization/api-access/)) page, [create an API key](https://docs.coveo.com/en/1718.md#create-a-custom-key) to which you grant the [privilege](https://docs.coveo.com/en/228.md) to edit extensions (that is, the **Edit** access level for the [**Extensions** domain](https://docs.coveo.com/en/1707.md#extensions-domain)).
See [Manage privileges](https://docs.coveo.com/en/3151.md) for details.

Create an extension for your organization.

1. Use the following API call:

   ```http
   POST https://platform.cloud.coveo.com/rest/organizations/<ORGANIZATION_ID>/extensions HTTP/1.1
   ```

   where you replace `<ORGANIZATION_ID>` with its corresponding value.

1. Your call must include the following HTTP headers:

   [%header,cols="2"]
   |===
   |Key
   |Value

|`Authorization`
|`Bearer <VALID_API_KEY>`

|`Content-Type`
|`application/json`
|===

1. The request body configures the extension, and it must include a name and description.
See [Create extension](https://docs.coveo.com/en/7.md#operation/createExtension) for details on the accepted body parameters.
For example:
+
```json
{
  "apiVersion": "v2", <1>
  "content": "document.add_meta_data({'userId':'YOUR_USER_ID'})", <2>
  "description": "This extension adds metadata...",
  "name": "Adding the userId metadata" <3>
}
```
<1> The `apiVersion` key specifies the [version of the API](https://docs.coveo.com/en/156.md#indexing-pipeline-extensions-api-versions) to use.
<2> The `content` key specifies the body of your extension (user script), written in Python using the [`document` object](https://docs.coveo.com/en/34.md).
<3> Choose a meaningful name for your extension, such as the name of the task that you want to perform.

1. Send your request.
It returns something like this:
+
```json
{
  "content": "document.add_meta_data({'userId':'YOUR_USER_ID'})",
  "description": "This extension adds metadata...",
  "enabled": true,
  "id": "coveosearch-rlic35pr6jhvtx84ta855bdj5j",
  "lastModified": 2588768294677,
  "name": "Adding the userId metadata",
  "versionId": "e3AOSVbGdwYus82z3gduTVPRqbXzidJg",
  "status": {
    "durationHealth": {
      "healthIndicator": "UNKNOWN"
    },
    "dailyStatistics": {
      "averageDurationInSeconds": 0,
      "numberOfExecutions": 0,
      "numberOfSkips": 0,
      "numberOfTimeouts": 0
    },
    "disabledStatus": {},
    "timeoutHealth": {
      "healthIndicator": "UNKNOWN"
    }
  }
}
```
+
where the `id` value is your unique extension identifier (`extensionId`).

On the Administration Console [**Activity Browser**](https://platform.cloud.coveo.com/admin/#/orgid/organization/activity-browser/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/organization/activity-browser/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/organization/activity-browser/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/organization/activity-browser/)) page, validate that your extension was successfully created.

1. In the **Sections** [facet](https://docs.coveo.com/en/198.md), select **Content**.

1. In the **Resource types** facet that appears, select **Extension**.

1. In the **Resources** facet, select your extension ID.

1. In the **Result** column, validate that your operation is successful.

## What's next?

[Apply your extension to a source](https://docs.coveo.com/en/1936.md).