---
title: "Send heartbeat"
method: POST
path: "/collectors/{key}/heartbeat"
tags: ["collectors"]
---

# Send heartbeat

`POST /collectors/{key}/heartbeat`

Send heartbeat. Access restricted to Refocus Collector only.

## Path parameters

- `key` string, required

## Request body

- object — Heartbeat from the collector.
  - `timestamp` integer — Access restricted to Refocus Collector only.
  - `collectorConfig` object
    - `osInfo` object
      - `arch` string — Access restricted to Refocus Collector only.
      - `hostname` string — Access restricted to Refocus Collector only.
      - `platform` string — Access restricted to Refocus Collector only.
      - `release` string — Access restricted to Refocus Collector only.
      - `type` string — Access restricted to Refocus Collector only.
      - `username` string — Access restricted to Refocus Collector only.
    - `processInfo` object
      - `execPath` string — Access restricted to Refocus Collector only.
      - `memoryUsage` object — Access restricted to Refocus Collector only.
      - `uptime` number — Access restricted to Refocus Collector only.
      - `version` string — Access restricted to Refocus Collector only.
      - `versions` object — Access restricted to Refocus Collector only.
    - `version` string — Access restricted to Refocus Collector only.

## Response `200`

Success.

- HeartbeatResponse — Gets the config and sample collection metadata from the Refocus server.
  - `collectorConfig` CollectorConfigResponse — Collector config variables changed since last heartbeat.
    - `heartbeatInterval` integer — The number of milliseconds to wait before aborting a request to Refocus.
    - `sampleCollectorTimeout` integer — The number of milliseconds to wait before aborting a request to a remote data source. This value may be overridden by each Generator.
    - `sampleUpsertQueueTime` integer — The maximum number of milliseconds that samples will wait before being sent to Refocus. When samples are returned by Generator transform, the Collector enqueues those samples to send as part of a larger bulk upsert to Refocus. In order to manage upsert load, a system-wide minimum sample upsert queue time will be defined in Refocus config; a Refocus admin will also be able to override that with a MINIMUM_SAMPLE_UPSERT_QUEUE_TIME environment variable.
    - `requireSslToRemoteDataSource` boolean — Default false. Refocus Collector will accept only external sources as HTTPS when set as true.
  - `generatersAdded` HeartbeatGeneratorResponse[] — List of generators assigned to this agent since last heartbeat. New generator templates are included as well.
    - `description` string — A description of the generator.
    - `helpEmail` string — The email address where a user can go to get more help about the generator.
    - `helpUrl` string — The url where a user can go to get more help about the generator.
    - `createdBy` string — Id of the User who created this Generator.
    - `id` string — The collector id.
    - `intervalSecs` integer — Interval (seconds) between each collection.
    - `isActive` boolean — Default false. When set to true, the generator will be assigned to a running collector and regularly send in samples.
    - `name` string — The generator's name.
    - `subjectQuery` string — The query to append to GET subjects. Only "absolutePath", "name", "tags" are allowed in subjectQuery.
    - `collectorGroup` object — Specifies set of collectors this Sample Generator should try to use.
    - `aspects` object[] — Array of aspects.
    - `tags` string[] — Array of tag names. Tag name: Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-). Tag names cannot start with a dash (-).
    - `connection` object — Information about the connection.
    - `context` object — Variables accessible inside the transform function.
    - `currentCollector` object — Current collector assigned to the generator.
    - `generatorTemplate` GeneratorTemplateResponse — The transform logic and the definition of what additional context data is required.
      - `description` string — A description of the generatorTemplate.
      - `helpEmail` string — The email address where a user can go to get more help about the generatorTemplate.
      - `helpUrl` string — The url where a user can go to get more help about the generatorTemplate.
      - `name` string — The generatorTemplate's name.
      - `version` string — The version, in semantic versioning format ( MAJOR.MINOR.PATCH )
      - `tags` string[] — Array of tag names. Tag name: Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-). Tag names cannot start with a dash (-).
      - `author` object — The author of this generatorTemplate.
      - `repository` object — The repository where this generatorTemplate is located.
      - `connection` object — Information about the connection.
      - `contextDefinition` object — Variables available to connection.url, connection.toUrl, and the transform function.
      - `transform` object — The body of a javascript function which transforms some data into an array of samples
      - `isPublished` boolean — Default false. When set to true, the generatorTemplate is available to all users.
      - `id` string — The generatorTemplate id.
      - `createdBy` string — Id of the User who created this generatorTemplate.
  - `generatersUpdated` HeartbeatGeneratorResponse[] — List of generators assigned to this agent, but were modified since last heartbeat.
    - `description` string — A description of the generator.
    - `helpEmail` string — The email address where a user can go to get more help about the generator.
    - `helpUrl` string — The url where a user can go to get more help about the generator.
    - `createdBy` string — Id of the User who created this Generator.
    - `id` string — The collector id.
    - `intervalSecs` integer — Interval (seconds) between each collection.
    - `isActive` boolean — Default false. When set to true, the generator will be assigned to a running collector and regularly send in samples.
    - `name` string — The generator's name.
    - `subjectQuery` string — The query to append to GET subjects. Only "absolutePath", "name", "tags" are allowed in subjectQuery.
    - `collectorGroup` object — Specifies set of collectors this Sample Generator should try to use.
    - `aspects` object[] — Array of aspects.
    - `tags` string[] — Array of tag names. Tag name: Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-). Tag names cannot start with a dash (-).
    - `connection` object — Information about the connection.
    - `context` object — Variables accessible inside the transform function.
    - `currentCollector` object — Current collector assigned to the generator.
    - `generatorTemplate` GeneratorTemplateResponse — The transform logic and the definition of what additional context data is required.
      - `description` string — A description of the generatorTemplate.
      - `helpEmail` string — The email address where a user can go to get more help about the generatorTemplate.
      - `helpUrl` string — The url where a user can go to get more help about the generatorTemplate.
      - `name` string — The generatorTemplate's name.
      - `version` string — The version, in semantic versioning format ( MAJOR.MINOR.PATCH )
      - `tags` string[] — Array of tag names. Tag name: Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-). Tag names cannot start with a dash (-).
      - `author` object — The author of this generatorTemplate.
      - `repository` object — The repository where this generatorTemplate is located.
      - `connection` object — Information about the connection.
      - `contextDefinition` object — Variables available to connection.url, connection.toUrl, and the transform function.
      - `transform` object — The body of a javascript function which transforms some data into an array of samples
      - `isPublished` boolean — Default false. When set to true, the generatorTemplate is available to all users.
      - `id` string — The generatorTemplate id.
      - `createdBy` string — Id of the User who created this generatorTemplate.
  - `generatorsRemoved` string[] — List of generators which used to be assigned to this agent but is no longer assigned to this agent. Array of generator names.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Resource Not Found

---

[API](https://skmtc.dev/salesforce/apis/refocus-api.md) · [All operations](https://skmtc.dev/salesforce/apis/refocus-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/salesforce/refocus-api/revisions/42c2153b047e/schema)
