---
title: "Create Contact"
full: true
_openapi:
  method: POST
  toc: []
  structuredData:
    headings: []
    contents:
      - content: "Creates contact"
_apiData:
  document: "https://reloop.sh/api/contacts/openapi/json"
  operationData: [{"path":"/api/contacts/create","method":"post"}]
  parameterList: [{"name":"email","type":"string","required":true,"description":"Contact email address","location":"body","pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},{"name":"firstName","type":"string","required":false,"description":"Contact first name","location":"body"},{"name":"lastName","type":"string","required":false,"description":"Contact last name","location":"body"},{"name":"status","type":"\"subscribed\" | \"unsubscribed\" | \"blocked\"","required":false,"description":"","location":"body","enumValues":["subscribed","unsubscribed","blocked"]},{"name":"properties","type":"object","required":false,"description":"Contact properties as key-value pairs","location":"body"},{"name":"groupIds","type":"string[]","required":false,"description":"Array of group IDs to add the contact to","location":"body"},{"name":"channels","type":"object[]","required":false,"description":"Array of channels to enroll the contact in","location":"body","properties":[{"name":"channelId","type":"string","required":true,"description":"Channel identifier","location":"body"},{"name":"subscription","type":"\"opt_in\" | \"opt_out\"","required":true,"description":"","location":"body","enumValues":["opt_in","opt_out"]}]}]
  responseMap: {"201":{"description":"Response for status 201","schema":{"object":"contact","id":"con_123456789","email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"},"groups":[{"id":"grp_123456789","name":"Beta Testers"}],"channels":[{"id":"channel_123456789","name":"Newsletter","subscription":"opt_in"}],"suppressionReason":null,"suppressedAt":null,"createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z","event":"evt_123456789"}},"400":{"description":"Response for status 400","schema":{"message":"Invalid email format","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead."}},"403":{"description":"Response for status 403","schema":{"message":"Unauthorized access","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead."}},"409":{"description":"Response for status 409","schema":{"message":"Contact already exists","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead."}}}
  codeSamples:
    - id: node
      lang: javascript
      label: Node.js
      source: |-
        import { Reloop } from "reloop-email";
        
        const reloop = new Reloop({ apiKey: "rl_123456789" });
        
        const { contact, contactError } = await reloop.contacts.create({
          email: "john.doe@example.com",
          firstName: "John",
          lastName: "Doe",
          status: "subscribed",
          properties: { company: "Reloop", role: "Developer" },
          groupIds: ["grp_123456789"],
          channels: [{ channelId: "chn_123456789", subscription: "opt_in" }],
        });
        if (contactError) throw contactError;
    - id: curl
      lang: bash
      label: cURL
      source: |-
        curl -X POST https://reloop.sh/api/contacts/create \
          -H "x-api-key: rl_123456789" \
          -H "Content-Type: application/json" \
          -d '{"email": "john.doe@example.com","firstName": "John","lastName": "Doe","status": "subscribed","properties": {"company": "Reloop","role": "Developer"},"groupIds": ["grp_123456789"],"channels": [{"channelId": "chn_123456789","subscription": "opt_in"}]}'
    - id: python
      lang: python
      label: Python
      source: |-
        from reloop_email import Reloop
        
        reloop = Reloop(api_key="rl_123456789")
        
        result = reloop.contacts.create({
          "email": "john.doe@example.com",
          "firstName": "John",
          "lastName": "Doe",
          "status": "subscribed",
          "properties": {
            "company": "Reloop",
            "role": "Developer",
          },
          "groupIds": ["grp_123456789"],
          "channels": [
            {
              "channelId": "chn_123456789",
              "subscription": "opt_in",
            },
          ],
        })
        if result.contact_error:
            raise result.contact_error
    - id: php
      lang: php
      label: PHP
      source: |-
        <?php
        
        require 'vendor/autoload.php';
        
        use Reloop\Reloop;
        
        $reloop = Reloop::client('rl_123456789');
        
        $contact = $reloop->contacts->create([
            'email' => 'john.doe@example.com',
            'firstName' => 'John',
            'lastName' => 'Doe',
            'status' => 'subscribed',
            'properties' => [
                'company' => 'Reloop',
                'role' => 'Developer',
            ],
            'groupIds' => ['grp_123456789'],
            'channels' => [
                [
                    'channelId' => 'chn_123456789',
                    'subscription' => 'opt_in',
                ],
            ],
        ]);
    - id: java
      lang: java
      label: Java
      source: |-
        import sh.reloop.ReloopClient;
        ReloopClient reloop = new ReloopClient("rl_123456789");
        
        CreateContactParams params = new CreateContactParams();
        params.email = "john.doe@example.com";
        params.firstName = "John";
        params.lastName = "Doe";
        params.status = "subscribed";
        params.properties = Map.of("company", "Reloop", "role", "Developer");
        params.groupIds = List.of("grp_123456789");
        params.channels = List.of(Map.of("channelId", "chn_123456789", "subscription", "opt_in"));
        var contact = reloop.contacts.create(params);
    - id: dotnet
      lang: csharp
      label: .NET
      source: |-
        using Reloop;
        using Reloop.Models;
        
        var reloop = new ReloopClient("rl_123456789");
        
        var contact = await reloop.Contacts.CreateAsync(new Dictionary<string, object?>
        {
            ["email"] = "john.doe@example.com",
            ["firstName"] = "John",
            ["lastName"] = "Doe",
            ["status"] = "subscribed",
        });
    - id: go
      lang: go
      label: Go
      source: |-
        import reloop "github.com/reloop-labs/reloop-go"
        
        client, _ := reloop.NewClient(reloop.ClientOptions{
            APIKey: "rl_123456789",
        })
        
        contact, _ := client.Contacts.Create(map[string]interface{}{
            "email": "john.doe@example.com",
            "firstName": "John",
            "lastName": "Doe",
            "status": "subscribed",
        })
    - id: rust
      lang: rust
      label: Rust
      source: |-
        use reloop::ReloopClient;
        #[tokio::main]
        async fn main() -> Result<(), Box<dyn std::error::Error>> {
            let reloop = ReloopClient::new("rl_123456789".to_string(), None);
        
            reloop.contacts().create(CreateContactParams {
                email: "john.doe@example.com".to_string(),
                first_name: Some("John".to_string()),
                last_name: Some("Doe".to_string()),
                status: Some(ContactStatus::Subscribed),
                ..Default::default()
            }).await?;
        
            Ok(())
        }
    - id: ruby
      lang: ruby
      label: Ruby
      source: |-
        require "reloop"
        
        reloop = Reloop::Client.new(api_key: "rl_123456789")
        
        contact = reloop.contacts.create(
          email: "john.doe@example.com",
          first_name: "John",
          last_name: "Doe",
          status: "subscribed",
          properties: { company: "Reloop", role: "Developer" },
          group_ids: ["grp_123456789"],
          channels: [{ channel_id: "chn_123456789", subscription: "opt_in" }],
        )
    - id: elixir
      lang: elixir
      label: Elixir
      source: |-
        client = Reloop.client("rl_123456789")
        
        {:ok, contact} = Reloop.Services.Contacts.create(client, %{
          email: "john.doe@example.com",
          first_name: "John",
          last_name: "Doe",
          status: "subscribed",
          properties: %{company: "Reloop", role: "Developer"},
          group_ids: ["grp_123456789"],
          channels: [%{channel_id: "chn_123456789", subscription: "opt_in"}]
        })
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


{/* This file was generated by the OpenAPI doc generator. Do not edit this file directly. Run `bun run generate:api-docs` to regenerate. */}

<APIPage />
