Skip to content

Error interface does not provide access to X-RateLimit headers #137

Open

Description

@pkpfr

Version info

  • intercom-go version: 1.0.0
  • Go version: 1.16.2

Expected behavior

If a request is rejected due to rate limiting, the information returned in the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset should be available through the error interface.

Actual behavior

If a request is rejected due to rate limiting, it is not possible to determine when to resubmit the request since the error interface does not contain any information regarding the limit reset time and there is no way for the client to access the response headers.

Activity

  1. uffejaeger commented on Jul 30, 2026

    @uffejaeger

    In case anyone still needs this, the new client I’m working on keeps the response headers on API errors:

    var apiErr *intercom.ErrorResponse
    if errors.As(err, &apiErr) {
        reset := apiErr.Headers.Get("X-RateLimit-Reset")
    }

    It can also report rate-limit values through a response hook and optionally retry 429s.

    Repo and docs: https://github.com/uffejaeger/intercom-go

    It’s unofficial and still pre-v1, but this particular behavior is covered by tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions