# Send-Your-Data management API

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdeveloper-portal%2Fapis%2Fdata-management%2Fsend-your-data-management-api.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdeveloper-portal%2Fapis%2Fdata-management%2Fsend-your-data-management-api.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

Coralogix provides an API that allows you to manage your [Send-Your-Data API keys](https://coralogix.com/docs/docs/user-guides/account-management/api-keys/send-your-data-api-key/.md).

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

* API Key with `ApiKeys` preset permissions. Access **Data Flow**, then **API Keys**.

[![](/docs/assets/images/keys-28dec2bcfd0953d0c12fdefafee5f0fe.webp)](https://coralogix.com/docs/docs/assets/images/keys-28dec2bcfd0953d0c12fdefafee5f0fe.webp)

* Select the
  <!-- -->
  api.:443
  <!-- -->
  endpoint that corresponds to your Coralogix [domain](https://coralogix.com/docs/docs/user-guides/account-management/account-settings/coralogix-domain/.md) using the domain selector at the top of the page.

## Create a new "Send Your Data" API key[​](#create-a-new-send-your-data-api-key "Direct link to Create a new \"Send Your Data\" API key")

```
grpcurl -H "Authorization: Bearer <YOUR-API-KEY>" -d @ api.eu2.coralogix.com:443 com.coralogixapis.aaa.apikeys.v3.ApiKeysService/CreateApiKey <<EOF

{

  "name": "my-api-key",

  "key_permissions": {

  	"presets": [    

            "SendData"    

        ]

  },  

  "owner": {

    "team_id": 000000

  },

  "hashed": false

}

EOF
```

### Request args[​](#request-args "Direct link to Request args")

| Field            | Description                                                                                                                                                                                                                                                                                                            |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key\_name        | Name of the key                                                                                                                                                                                                                                                                                                        |
| key\_permissions | Specifies the permissions assigned to this key. For "Send Your Data" keys, the only value that should be used is the SendData permissions preset. (Note: A preset is a predefined group of permissions tailored to a specific role. A key can be assigned either individual permissions directly or through a preset.) |
| owner            | Defines who can be the owner of the key. The only available value at present is the team\_id.                                                                                                                                                                                                                          |
| hashed           | Whether the key should be stored securely. If hashed, key value will be disclosed only once in create response.                                                                                                                                                                                                        |

### Response[​](#response "Direct link to Response")

The response will be a message with information about the created key.

```
{

  "key_id": "c8d84762-9aff-4f90-93ef-1762757e0c2c",

  "name": "my-api-key",

  "value": "<key_value>",

  }

}
```

| Field   | Description                                                                           |
| ------- | ------------------------------------------------------------------------------------- |
| key\_id | ID of the key                                                                         |
| name    | Assigned name to the key                                                              |
| Value   | Value of the key. For securely stored keys, this is the only time it will be visible. |

## Update "Send Your Data" API Key[​](#update-send-your-data-api-key "Direct link to Update \"Send Your Data\" API Key")

```
grpcurl -H "Authorization: Bearer Bearer <YOUR-API-KEY>" -d @ api.eu2.coralogix.com:443 com.coralogixapis.aaa.apikeys.v3.ApiKeysService/UpdateApiKey <<EOF

{

  "key_id": "252d3765-069a-4f32-b79a-18e60f4c7b61",

  "is_active": false,

  "new_name": "Some new name"

}

EOF
```

### Request args[​](#request-args-1 "Direct link to Request args")

| Field      | Description                                                |
| ---------- | ---------------------------------------------------------- |
| key\_id    | ID of the key                                              |
| is\_active | If provided, defines if key should be active or not        |
| new\_name  | If provided, new name that will be correlated with the key |

### Response[​](#response-1 "Direct link to Response")

The response will be an empty message.

## Get a "Send Your Data" API key by ID[​](#get-a-send-your-data-api-key-by-id "Direct link to Get a \"Send Your Data\" API key by ID")

```
grpcurl -H "Authorization: Bearer <YOUR-API-KEY>" -d @ api.eu2.coralogix.com:443 com.coralogixapis.aaa.apikeys.v3.ApiKeysService/GetApiKey <<EOF

{

  "key_id": "252d3765-069a-4f32-b79a-18e60f4c7b61"

}

EOF
```

### Request args[​](#request-args-2 "Direct link to Request args")

| Field   | Description                                 |
| ------- | ------------------------------------------- |
| key\_id | Id of they key send data key to be returned |

### Response[​](#response-2 "Direct link to Response")

The response will be an message with API key information:

```
{

  "key_info": {

    "id": "252d3765-069a-4f32-b79a-18e60f4c7b61",

    "name": "Some key name",

    "owner": {

      "team_id": 0000

    },

    "active": false,

    "hashed": false,

    "key_permissions": {

      "presets": [

        {

          "permissions": [

            "cloud-metadata-ingress:SendData",

            "logs.data-ingress:SendData",

            "metrics.data-ingress:SendData",

            "spans.data-ingress:SendData",

            "contextual-data:SendData"

          ],

          "name": "SendData"

        }

      ],

      "permissions": []

    },

    "value": "<key_value>"

  }

}
```

| Field             | Description                                                                                              |
| ----------------- | -------------------------------------------------------------------------------------------------------- |
| id                | ID of the key                                                                                            |
| name              | Assigned name to the key                                                                                 |
| owner             | Who owns the key                                                                                         |
| active Key Active | If key is in active state                                                                                |
| hashed            | Whether the key is stored securely. If hashed, key value is only disclosed once in create response       |
| key\_permissions  | Permissions assigned to this key come either from presets (predefined groups of permissions) or directly |
| value             | Optional value of the key. If key is stored securely, this field will not be sent                        |

## Get all "Send Your Data" API keys owned by caller of the endpoint[​](#get-all-send-your-data-api-keys-owned-by-caller-of-the-endpoint "Direct link to Get all \"Send Your Data\" API keys owned by caller of the endpoint")

The caller can be either a user or a team, determined by the authentication context in which the call is performed

```
grpcurl -H "Authorization: Bearer <YOUR-API-KEY>" -d @ api.eu2.coralogix.com:443 com.coralogixapis.aaa.apikeys.v3.ApiKeysService/GetSendDataApiKeys <<EOF

{

}

EOF
```

### Request args[​](#request-args-3 "Direct link to Request args")

No args

### Response[​](#response-3 "Direct link to Response")

The response will be a message with a list of all "Send Your Data" API keys owned by caller:

```
{

  "keys": [

    {

      "key_info": {

        "id": "252d3765-069a-4f32-b79a-18e60f4c7b61",

        "name": "Some key name",

        "owner": {

          "team_id": 0000

        },

        "active": false,

        "hashed": false,

        "key_permissions": {

          "presets": [

            {

              "permissions": [

                "cloud-metadata-ingress:SendData",

                "logs.data-ingress:SendData",

                "metrics.data-ingress:SendData",

                "spans.data-ingress:SendData",

                "contextual-data:SendData"

              ],

              "name": "SendData"

            }

          ],

          "permissions": []

        },

        "value": "<key_value>"

      }

    }

  ]

}
```

List of

| Field             | Description                                                                                              |
| ----------------- | -------------------------------------------------------------------------------------------------------- |
| id                | ID of the key                                                                                            |
| name              | Assigned name to the key                                                                                 |
| owner             | Who owns the key                                                                                         |
| active Key Active | If key is in active state                                                                                |
| hashed            | Whether the key is stored securely. If hashed, key value is only disclosed once in create response       |
| key\_permissions  | Permissions assigned to this key come either from presets (predefined groups of permissions) or directly |
| value             | Optional value of the key. If key is stored securely, this field will not be sent                        |

## Additional resources[​](#additional-resources "Direct link to Additional resources")

|                     |                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------- |
| Coralogix Endpoints | [Coralogix Endpoints](https://coralogix.com/docs/docs/integrations/coralogix-endpoints/.md) |
