API reference

createShortUrl

Required permission: LabelWrite

graphql
createShortUrl(
  whiteLabelId: ID!
  input: ShortUrlInput!
): ShortUrl

Arguments

Name Type Description
whiteLabelId ID!
input ShortUrlInput!

Returns

ShortUrl

Example

graphql
mutation CreateShortUrl($whiteLabelId: ID!, $input: ShortUrlInput!) {
  createShortUrl(whiteLabelId: $whiteLabelId, input: $input) {
    smartLink
    target
    url
  }
}
bash
curl https://api.thelocoapp.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LOCO_API_KEY" \
  -d '{"query": "mutation { createShortUrl(...) { __typename } }"}'