Managing OpenGraph Metadata for Links

The OpenGraph API endpoint allows you to manage OpenGraph metadata for branded short links. You can retrieve, create, or delete OpenGraph metadata associated with a link. OpenGraph metadata enhances how links appear on social media platforms and includes fields like title, description, image, type, and locale.

Endpoint Overview

Base URL:

https://api.rebrandly.com/v1/links/{id}/opengraph

Operations

Get OpenGraph Metadata
Retrieve the OpenGraph metadata of a specific branded short link.

HTTP Method: GET
Authorization: Requires an API key and appropriate permissions.

$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/opengraph' \
-H 'apikey: YOUR_API_KEY'

Example Response

{
  "title": "What is Rebrandly",
  "description": "Learn about branded short links.",
  "image": "https://rebrandly.com/example.jpg",
  "type": "website",
  "locale": "en_US"
}

Create or Update OpenGraph Metadata

Add or update OpenGraph metadata for a link.

HTTP Method: POST
Authorization: Requires owner or admin role. The feature must be enabled for the workspace.

Request Body:

  • title (string): The OpenGraph title. (Required)
  • description (string): A brief description. (Optional)
  • image (string): URL of the OpenGraph image. (Optional)
  • type (string): The OpenGraph object type. (Optional)
  • locale (string): The language/locale code. (Optional)

Validation Rules:

  • title must be a non-empty string.
  • description, image, type, and locale must be strings if provided.
$ curl -X POST 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/opengraph' \
-H 'apikey: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
  "title": "What is Rebrandly",
  "description": "Learn about branded short links.",
  "image": "https://rebrandly.com/example.jpg",
  "type": "website",
  "locale": "en_US"
}'

Example Response

{
  "title": "What is Rebrandly",
  "description": "Learn about branded short links.",
  "image": "https://rebrandly.com/example.jpg",
  "type": "website",
  "locale": "en_US"
}

Delete OpenGraph Metadata

Remove OpenGraph metadata from a specific link.

HTTP Method: DELETE
Authorization: Requires owner or admin role.

$ curl -X DELETE 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/opengraph' \
-H 'apikey: YOUR_API_KEY'

Example Response

{}

PATH PARAMETERS

Path parameterDescription
idThe unique identifier of the branded short link whose OpenGraph data is being managed.

Handling errors

HTTP StatusError typeDescription
401UnaAPI key missing or user lacks permissions.
404Not foundGiven id does not correspond to any existing link
403Validation errorOne or more fields in the request body are invalid.