New JuneDevelopers
API reference

me

The API key making the request, and its limits.

View .md
EndpointsScope any key
  • GET/v1/meGet the current API key

The key making the request. Use it to check that a key works, which scopes it has, and the limits that apply to it. It returns no golf data.

The key context object

FieldTypeDescription
objectstringAlways "api_key_context".
keyobjectThe key used for this request.
key.objectstringAlways "api_key".
key.idstringUnique id of the API key.
key.namestringThe name you gave the key.
key.prefixstringThe first characters of the key, for telling keys apart.
key.scopesarray of stringsWhat the key may read.
key.expires_atstring (timestamp) or nullWhen the key stops working. Null when it does not expire.
limitsobjectRate limits that apply to this key.
limits.requests_per_minuteintegerRequests this key may make per minute.
limits.requests_per_dayintegerRequests per UTC day, shared by all of your keys. Resets at midnight UTC.

Example key context:

{
  "object": "api_key_context",
  "key": {
    "object": "api_key",
    "id": "53e13cb8-f578-4bf4-958c-3c3faea4c7d4",
    "name": "Spreadsheet sync",
    "prefix": "nj_live_3f9a",
    "scopes": [
      "plans:read",
      "rounds:read"
    ],
    "expires_at": "2027-06-01T00:00:00.000Z"
  },
  "limits": {
    "requests_per_minute": 60,
    "requests_per_day": 1000
  }
}

Endpoints

Responses carry Request-Id, RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, and a 429 adds Retry-After. See Headers.

Get the current API key

The key used for this request, its scopes, and its limits. Works with any valid key.

GET/v1/me
AuthorizationBearer <token>

A personal API key (nj_live_...), sent as a bearer token. Create one on the Developer page at https://newjune.co/golf/developer. The scopes listed on each operation are the key scopes it needs.

In: header

Response Body

curl "https://data.newjune.co/v1/me" \
  -H "Authorization: Bearer $NEW_JUNE_API_KEY"
{
  "object": "api_key_context",
  "key": {
    "object": "api_key",
    "id": "53e13cb8-f578-4bf4-958c-3c3faea4c7d4",
    "name": "Spreadsheet sync",
    "prefix": "nj_live_3f9a",
    "scopes": [
      "plans:read",
      "rounds:read"
    ],
    "expires_at": "2027-06-01T00:00:00.000Z"
  },
  "limits": {
    "requests_per_minute": 60,
    "requests_per_day": 1000
  }
}

{
  "error": {
    "type": "authentication_error",
    "code": "api_key_expired",
    "message": "This API key has expired. Create a new key on the Developer page at newjune.co/golf/developer.",
    "param": null,
    "request_id": "req_5f0c6e2a9b1d4c7e8f3a2b10",
    "doc_url": "https://developers.newjune.co/errors#api_key_expired"
  }
}

{
  "error": {
    "type": "permission_error",
    "code": "account_suspended",
    "message": "API access is suspended for this account.",
    "param": null,
    "request_id": "req_5f0c6e2a9b1d4c7e8f3a2b10",
    "doc_url": "https://developers.newjune.co/errors#account_suspended"
  }
}

{
  "error": {
    "type": "rate_limit_error",
    "code": "daily_limit_exceeded",
    "message": "This account has reached its daily request limit. It resets at midnight UTC.",
    "param": null,
    "request_id": "req_5f0c6e2a9b1d4c7e8f3a2b10",
    "doc_url": "https://developers.newjune.co/errors#daily_limit_exceeded"
  }
}

{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "Something went wrong on our side. Try again later.",
    "param": null,
    "request_id": "req_5f0c6e2a9b1d4c7e8f3a2b10",
    "doc_url": "https://developers.newjune.co/errors#internal_error"
  }
}

{
  "error": {
    "type": "api_error",
    "code": "service_unavailable",
    "message": "The API is temporarily unavailable. Try again later.",
    "param": null,
    "request_id": "req_5f0c6e2a9b1d4c7e8f3a2b10",
    "doc_url": "https://developers.newjune.co/errors#service_unavailable"
  }
}