[Документация Yandex Cloud](../../../../../index.md) > [Yandex Serverless Integrations](../../../../index.md) > Справочник API EventRouter > [gRPC (англ.)](../index.md) > [Connector](index.md) > Create

# EventRouter Service, gRPC: ConnectorService.Create

Creates a connector in the specified folder.

## gRPC request

**rpc Create ([CreateConnectorRequest](#yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest)) returns ([operation.Operation](#yandex.cloud.operation.Operation))**

## CreateConnectorRequest {#yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest}

```json
{
  "bus_id": "string",
  "name": "string",
  "description": "string",
  "labels": "map<string, string>",
  "source": {
    // Includes only one of the fields `data_stream`, `message_queue`, `event_service_source`, `timer`, `audit_trails`
    "data_stream": {
      "database": "string",
      "stream_name": "string",
      "consumer": "string",
      "service_account_id": "string"
    },
    "message_queue": {
      "queue_arn": "string",
      "service_account_id": "string",
      "visibility_timeout": "google.protobuf.Duration",
      "batch_size": "int64",
      "polling_timeout": "google.protobuf.Duration"
    },
    "event_service_source": "EventServiceSource",
    "timer": {
      "cron_expression": "string",
      "time_zone": "string",
      "payload": "string"
    },
    "audit_trails": "AuditTrails"
    // end of the list of possible fields
  },
  "deletion_protection": "bool"
}
```

#|
||Field | Description ||
|| bus_id | **string**

Required field. ID of the bus to create a connector in. ||
|| name | **string**

Name of the connector.

Value must match the regular expression ``` |[a-z][-a-z0-9]{1,61}[a-z0-9] ```. ||
|| description | **string**

Description of the connector.

The maximum string length in characters is 256. ||
|| labels | **object** (map<**string**, **string**>)

Labels for the connector.

The maximum string length in characters for each value is 63. The string length in characters for each key must be 1-63. Each key must match the regular expression ` [a-z][-_0-9a-z]* `. Each value must match the regular expression ` [-_0-9a-z]* `. No more than 64 per resource. ||
|| source | **[Source](#yandex.cloud.serverless.eventrouter.v1.Source)**

Source of the connector. ||
|| deletion_protection | **bool**

Flag that disallow deletion of the connector. ||
|#

## Source {#yandex.cloud.serverless.eventrouter.v1.Source}

#|
||Field | Description ||
|| data_stream | **[DataStream](#yandex.cloud.serverless.eventrouter.v1.DataStream)**

Includes only one of the fields `data_stream`, `message_queue`, `event_service_source`, `timer`, `audit_trails`. ||
|| message_queue | **[MessageQueue](#yandex.cloud.serverless.eventrouter.v1.MessageQueue)**

Includes only one of the fields `data_stream`, `message_queue`, `event_service_source`, `timer`, `audit_trails`. ||
|| event_service_source | **[EventServiceSource](#yandex.cloud.serverless.eventrouter.v1.EventServiceSource)**

Includes only one of the fields `data_stream`, `message_queue`, `event_service_source`, `timer`, `audit_trails`. ||
|| timer | **[Timer](#yandex.cloud.serverless.eventrouter.v1.Timer)**

Includes only one of the fields `data_stream`, `message_queue`, `event_service_source`, `timer`, `audit_trails`. ||
|| audit_trails | **[AuditTrails](#yandex.cloud.serverless.eventrouter.v1.AuditTrails)**

Includes only one of the fields `data_stream`, `message_queue`, `event_service_source`, `timer`, `audit_trails`. ||
|#

## DataStream {#yandex.cloud.serverless.eventrouter.v1.DataStream}

#|
||Field | Description ||
|| database | **string**

Required field. Stream database.
example: /ru-central1/aoegtvhtp8ob********/cc8004q4lbo6******** ||
|| stream_name | **string**

Required field. Stream name, absolute or relative. ||
|| consumer | **string**

Required field. Consumer name. ||
|| service_account_id | **string**

Required field. Service account which has read permission on the stream. ||
|#

## MessageQueue {#yandex.cloud.serverless.eventrouter.v1.MessageQueue}

#|
||Field | Description ||
|| queue_arn | **string**

Required field. Queue ARN.
Example: yrn:yc:ymq:ru-central1:aoe***:test ||
|| service_account_id | **string**

Required field. Service account which has read access to the queue.

The maximum string length in characters is 50. ||
|| visibility_timeout | **[google.protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/duration)**

Queue visibility timeout override. ||
|| batch_size | **int64**

Batch size for polling.

The maximum value is 10. ||
|| polling_timeout | **[google.protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/duration)**

Queue polling timeout. ||
|#

## EventServiceSource {#yandex.cloud.serverless.eventrouter.v1.EventServiceSource}

#|
||Field | Description ||
|| Empty | > ||
|#

## Timer {#yandex.cloud.serverless.eventrouter.v1.Timer}

#|
||Field | Description ||
|| cron_expression | **string**

Required field. cron expression, with second precision

The maximum string length in characters is 100. ||
|| time_zone | **string**

time zone, e.g. Europe/Moscow ||
|| payload | **string**

payload to send to target

The maximum string length in characters is 4096. ||
|#

## AuditTrails {#yandex.cloud.serverless.eventrouter.v1.AuditTrails}

#|
||Field | Description ||
|| Empty | > ||
|#

## operation.Operation {#yandex.cloud.operation.Operation}

```json
{
  "id": "string",
  "description": "string",
  "created_at": "google.protobuf.Timestamp",
  "created_by": "string",
  "modified_at": "google.protobuf.Timestamp",
  "done": "bool",
  "metadata": "google.protobuf.Any",
  // Includes only one of the fields `error`, `response`
  "error": "google.rpc.Status",
  "response": "google.protobuf.Any"
  // end of the list of possible fields
}
```

An Operation resource. For more information, see [Operation](../../../../../api-design-guide/concepts/operation.md).

#|
||Field | Description ||
|| id | **string**

ID of the operation. ||
|| description | **string**

Description of the operation. 0-256 characters long. ||
|| created_at | **[google.protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp)**

Creation timestamp. ||
|| created_by | **string**

ID of the user or service account who initiated the operation. ||
|| modified_at | **[google.protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp)**

The time when the Operation resource was last modified. ||
|| done | **bool**

If the value is `false`, it means the operation is still in progress.
If `true`, the operation is completed, and either `error` or `response` is available. ||
|| metadata | **[google.protobuf.Any](https://developers.google.com/protocol-buffers/docs/proto3#any)**

Service-specific metadata associated with the operation.
It typically contains the ID of the target resource that the operation is performed on.
Any method that returns a long-running operation should document the metadata type, if any. ||
|| error | **[google.rpc.Status](https://cloud.google.com/tasks/docs/reference/rpc/google.rpc#status)**

The error result of the operation in case of failure or cancellation.

Includes only one of the fields `error`, `response`.

The operation result.
If `done == false` and there was no failure detected, neither `error` nor `response` is set.
If `done == false` and there was a failure detected, `error` is set.
If `done == true`, exactly one of `error` or `response` is set. ||
|| response | **[google.protobuf.Any](https://developers.google.com/protocol-buffers/docs/proto3#any)**

The normal response of the operation in case of success.
If the original method returns no data on success, such as Delete,
the response is [google.protobuf.Empty](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Empty).
If the original method is the standard Create/Update,
the response should be the target resource of the operation.
Any method that returns a long-running operation should document the response type, if any.

Includes only one of the fields `error`, `response`.

The operation result.
If `done == false` and there was no failure detected, neither `error` nor `response` is set.
If `done == false` and there was a failure detected, `error` is set.
If `done == true`, exactly one of `error` or `response` is set. ||
|#