# Create or update an entitlement
Source: https://docs.lomi.africa/api/usage/UsageBillingController_createEntitlement

Create or update an entitlement

***

title: "Create or update an entitlement"
description: "Create or update an entitlement"
full: true
method: post
path: /usage/entitlements
operationId: UsageBillingController\_createEntitlement
------------------------------------------------------

## Overview

Create or update an entitlement

Defines a plan entitlement feature keyed by `feature_key` for usage or access gating.

### When to use this

Use when feature access is tied to plan entitlements rather than raw meter balance alone.

### See also

[Check entitlement](/api/usage/UsageBillingController_checkEntitlement) · [Usage billing guide](/build/billing/usage-billing)

## Authentication

Merchant routes require an API key in the `X-API-KEY` header (see [Integration overview](/api)). Use a **test** key against `https://sandbox.api.lomi.africa` and a **live** key against `https://api.lomi.africa`.

## Endpoint

`POST /usage/entitlements`

Base URLs:

* `https://sandbox.api.lomi.africa`
* `https://api.lomi.africa`

## Request

### Path parameters

*No path parameters beyond the URL pattern.*

### Query parameters

*No query parameters.*

### Request body

*No application/json body for this operation.*

## Responses

| Status | Description          |
| ------ | -------------------- |
| `201`  | Created successfully |

## Errors

Errors follow the standard JSON error format (status code and machine-readable message). Validate inputs before calling; **401** indicates a missing/invalid key, **404** a missing resource for this organization, **429** rate limiting. For safe retries on create-style calls, send an idempotency key when your flow supports it.

## Example

```bash
curl -sS -X POST "https://sandbox.api.lomi.africa/usage/entitlements" \
  -H "X-API-KEY: $LOMI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## OpenAPI

* **operationId**: `UsageBillingController_createEntitlement`
* **Operation**: `POST /usage/entitlements`

Full schemas and **Try it**: [API reference](/api). Machine-readable contract: repo `apps/docs/openapi.json`.
