# Overview

{% content-ref url="/pages/gj2tumO4KAaLS2prOjRN" %}
[Authentication](/getting-started/overview/authentication)
{% endcontent-ref %}

{% content-ref url="/pages/I2zWfvnz1dcAL6wKYbNs" %}
[Rate limiting](/getting-started/overview/rate-limiting)
{% endcontent-ref %}

{% content-ref url="/pages/DHpTieSHuLl1qjFOcbdi" %}
[Errors](/getting-started/overview/errors)
{% endcontent-ref %}


# Authentication

[Copyfactory](https://copyfactory.io) uses API keys to allow access to the API. You can get an API key by to your account settings in Copyfactory. There is also a link in the nav that takes you directly to your account page.

Copyfactory expects the API key to be included in all API requests to the server in a header that looks like the following:

`Authorization: API_KEY`

## Test your connection

To make your first request, send an authenticated request to the /me endpoint. This will provide you with your account status.

## Get account details

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/me`

Test connection.

#### Headers

| Name                                            | Type   | Description          |
| ----------------------------------------------- | ------ | -------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | You account API key. |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
  "message": "Authorized",
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/me' \
--header 'Authorization: API-KEY'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://app.copyfactory.io/api/v2/me"

headers = {
  'Authorization': 'API-KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}


# Rate limiting

#### Handling rate limts <a href="#handling-rate-limts" id="handling-rate-limts"></a>

A  technique for handling rate limiting is to watch for `429` status codes and build in a retry mechanism. The retry mechanism should follow an exponential backoff schedule to reduce request volume when necessary.

When you are being rate limited you will receive a 'Retry-After' key in the response headers with how many seconds you should wait before trying again.

The current rate limit is **200 per minute.**

<br>


# Errors

These are the common errors that could be returned by our API:

| HTTP Code | Description                                  |
| --------- | -------------------------------------------- |
| 403       | Authentication credentials were not provided |
| 404       | The requested resource could not be found    |
| 429       | Rate limited, please try again               |
| 503       | Server error, please retry                   |


# Playbooks


# The playbook object

| Attribute          | Type   | Description                         |
| ------------------ | ------ | ----------------------------------- |
| id                 | int    | Unique identifier for the playbook. |
| profile\_name      | string | The profile name of the playbook    |
| playbook\_name     | string | The name of the playbook            |
| created\_timestamp | string | The date the playbook was created   |


# List playbooks

## List playbooks

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/playbooks/list/`

List playbooks.

#### Query Parameters

| Name        | Type | Description          |
| ----------- | ---- | -------------------- |
| profile\_id | int  | Filter by profile ID |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
	'data': [{
	'id': 1,
	'playbook_name': 'My playbook',
	'created_timestamp': '2022-06-13T10:13:14.188Z',
	'profile_name': 'CF'
    }]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/playbooks/list/' \
--header 'Authorization: API-KEY' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Python" %}

```
import requests
import json

url = f"https://app.copyfactory.io/api/v2/playbooks/list/"

headers = {
  'Authorization': 'API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}


# Sequences


# The sequence object

| Attribute      | Type   | Description                                                    |
| -------------- | ------ | -------------------------------------------------------------- |
| id             | int    | Unique identifier for the sequence.                            |
| profile\_name  | string | The profile of the sequence                                    |
| sequence\_name | string | The name of the sequence                                       |
| is\_request    | bool   | True/False if the sequence was a done-for-you sequence request |
| create\_date   | string | The date the sequence was created                              |


# List sequences

## List sequences

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/sequences/list/`

List sequences of your Copyfactory account.

#### Query Parameters

| Name        | Type | Description          |
| ----------- | ---- | -------------------- |
| profile\_id | int  | Filter by profile ID |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
	'data': [{
		'id': 1,
		'is_request': False,
		'profile_name': 'CF',
		'sequence_name': 'Seq',
		'create_date': '2022-06-13T10:12:24.885Z'
	},]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/sequences/list/' \
--header 'Authorization: API-KEY' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Python" %}

```
import requests
import json

url = f"https://app.copyfactory.io/api/v2/sequences/list/"

headers = {
  'Authorization': 'API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}


# Contacts

Create contacts.


# The contact object

| Attribute               | Type   | Description                                                                               |
| ----------------------- | ------ | ----------------------------------------------------------------------------------------- |
| id                      | int    | Unique identifier for the contact.                                                        |
| email                   | string | The email of the contact                                                                  |
| custom\_fields          | Object | Object containing the custom fields for that contact                                      |
| sentence\_fields        | Object | Object containing all the sentences that have been generated for the contact              |
| sequence\_name          | string | Name of the sequence the contact belongs to                                               |
| linked\_in\_handle      | string | The LinkedIn handle the contact belongs to                                                |
| enriched\_contact\_data | Object | Contains all the enriched prospect data we were able to pull based on the LinkedIn handle |
| enriched\_company\_data | Object | Contains all the enriched company data we were able to pull based on the LinkedIn handle  |


# Create contact

{% hint style="info" %}
Contacts with emails that already exist for the target sequence will now be processed as they are duplicates. You will receive a success message however.
{% endhint %}

## Create a new contact in Copyfactory

<mark style="color:green;">`POST`</mark> `https://app.copyfactory.io/api/v2/contact/`

Create a new contact in Copyfactory.

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Copyfactory API key |

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                |
| ---------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| email<mark style="color:red;">\*</mark>        | String | The contacts email.                                                                                                                                                        |
| sequence\_id<mark style="color:red;">\*</mark> | int    | The ID of the sequence to add the contact to.                                                                                                                              |
| playbook\_id<mark style="color:red;">\*</mark> | int    | The ID of the playbook you want to run for the contact.                                                                                                                    |
| linkedin\_handle                               | String | The LinkedIn handle of the contact. Required if using data enrichment.                                                                                                     |
| do\_enrichment                                 | Bool   | True/False as to enrich the contact.                                                                                                                                       |
| custom\_fields                                 | Object | Custom fields you wish to add for the contact where the key is the name of the custom field in Copyfactory and the value is the value you want to associate to that field. |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    'data': {'status': 'Contact successfully queued.'}
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request POST 'https://app.copyfactory.io/api/v2/contact/' \
--header 'Authorization: API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": 'email@email.com',
    "sequence_id": 0,
    "linkedin_handle": 'https://www.linkedin.com/in/my-handle/',
    "playbook_id": 0,
    "do_enrichment": False,
    "custom_fields": {'custom_field':'Custom value'},
}'
```

{% endtab %}

{% tab title="Python" %}

```
import requests
import json

url = "https://app.copyfactory.io/api/v2/contact/"

payload = json.dumps({
    "email": 'email@email.com',
    "sequence_id": 0,
    "linkedin_handle": 'https://www.linkedin.com/in/my-handle/',
    "playbook_id": 0,
    "do_enrichment": False,
    "custom_fields": {'custom_field':'Custom value'},
})

headers = {
  'Authorization': 'API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}


# Get contact

## Get a contact by it's ID.

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/contact/<contactID>/`

Get a contact in Copyfactory.

#### Path Parameters

| Name                                          | Type | Description                                 |
| --------------------------------------------- | ---- | ------------------------------------------- |
| contact\_id<mark style="color:red;">\*</mark> | Int  | The ID for the contact you want to retrieve |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    'data': {
	'id': 6,
	'email': 'email@domain.io',
	'custom_fields': {
		'post_author': 'Mike',
		'company_organization_name': 'Apple'
	},
	'sentence_fields': {
		'snip1': 'This is great',
		'snip2': 'Great post!',
		'snip4': 'I see you are from Seattle, how do you think the Mariners will do? They have been doing really well this season.'
	},
	'sequence_name': 'Seq',
	'linked_in_handle': 'https://www.linkedin.com/in/',
	'enriched_contact_data': {
		'city': 'Sioux Falls',
		'state': 'South Dakota',
		'groups': [],
		'country': 'US',
		'summary': 'Experienced Sales Specialist with a demonstrated history of growing long-term relationships. Skilled in Outbound & Inbound Sales, Management, Customer Experience, Digital Marketing, and Training, Social Media, and CRM usage, including personal video engagement and email automation/3rd party API integration.',
		'articles': [],
		'headline': None,
		'education': [{
			'school': 'South Dakota State University',
			'ends_at': {
				'day': 31,
				'year': 1999,
				'month': 12
			},
			'logo_url': 'https://media-exp2.licdn.com/dms/image/C510BAQEzCqmfFDgExg/company-logo_400_400/0/1519856534459?e=1663804800&v=beta&t=-K57aHPSkKTN7Lly0CHoFLLiWJEXZ6Geme73hQMRom4',
			'starts_at': {
				'day': 1,
				'year': 1995,
				'month': 1
			},
			'degree_name': 'B.S.',
			'description': None,
			'field_of_study': 'Geography',
			'school_linkedin_profile_url': None
		}],
		'full_name': 'Eric Anderson',
		'languages': [],
		'last_name': 'Anderson',
		'activities': [],
		'first_name': 'Eric',
		'occupation': 'Sales Manager at Uptics ',
		'connections': None,
		'experiences': [{
			'title': 'Sales Manager',
			'company': 'Uptics ',
			'ends_at': None,
			'location': 'Sioux Falls, SD ',
			'logo_url': 'https://media-exp2.licdn.com/dms/image/C4E0BAQF1pPNQ2vllXQ/company-logo_400_400/0/1641413912350?e=1663804800&v=beta&t=njTPLoe3ajrtoHIDYIyEzYxjeMb7ihjRIZSGdz_4RKo',
			'starts_at': {
				'day': 1,
				'year': 2022,
				'month': 6
			},
			'description': None,
			'company_linkedin_profile_url': 'https://www.linkedin.com/company/uptics/'
		}, {
			'title': 'Account Manager',
			'company': 'Fully Promoted Sioux Falls (formerly EmbroidMe)',
			'ends_at': {
				'day': 31,
				'year': 2022,
				'month': 1
			},
			'location': 'Sioux Falls, South Dakota, United States',
			'logo_url': 'https://media-exp2.licdn.com/dms/image/C4D0BAQFvvmku28swVA/company-logo_400_400/0/1519921269861?e=1663804800&v=beta&t=t9U9qyJTddtXMGQppGp1JlmfbH5dzTZtlRVv5n4-zAg',
			'starts_at': {
				'day': 1,
				'year': 2021,
				'month': 6
			},
			'description': 'Fully Promoted Sioux Falls is the leading promotional company in the marketing world. We help other businesses to grow by promoting them through embroidery, screen printing, direct garment printing, transfers and promotional items.',
			'company_linkedin_profile_url': 'https://www.linkedin.com/company/fully-promoted-sioux-falls-formerly-embroidme-/'
		}, {
			'title': 'Sales ',
			'company': 'Building Start',
			'ends_at': {
				'day': 28,
				'year': 2021,
				'month': 2
			},
			'location': 'Sioux Falls, South Dakota, United States',
			'logo_url': 'https://media-exp2.licdn.com/dms/image/C560BAQHlSNMOb3sdKg/company-logo_400_400/0/1519893965106?e=1663804800&v=beta&t=q3bgCIWRfH3wBVTxHkghEYIeupy8VRRJxPTvZQqn7eo',
			'starts_at': {
				'day': 1,
				'year': 2020,
				'month': 8
			},
			'description': 'Building Start is a SaaS provider that enables anyone who uses large checklists or does extensive field data documentation to get rid of antiquated methods such as using paper or Excel. I help organizations improve collaboration, greatly enhance reporting capabilities, document issues/deficiencies/issues with our field tools, and add to the bottom line. Our platform is proprietary and has many case studies showing direct impact made by transitioning to our software.',
			'company_linkedin_profile_url': 'https://www.linkedin.com/company/building-start/'
		}, {
			'title': 'Sales Engineer',
			'company': 'Lead Engine Sales & Marketing ',
			'ends_at': {
				'day': 31,
				'year': 2019,
				'month': 10
			},
			'location': 'Brandon, SD',
			'logo_url': 'https://media-exp2.licdn.com/dms/image/C4E0BAQFYxW7ErhskNA/company-logo_400_400/0/1578886753053?e=1663804800&v=beta&t=DIfZiRrx4yI3-0lvA0gDRCBOeNdo7VvZ-27jjeAG66M',
			'starts_at': {
				'day': 1,
				'year': 2019,
				'month': 3
			},
			'description': 'I help people in the technology and consulting sectors broker meetings with qualified leads by utilizing advertising campaigns and high-quality prospecting techniques. \nWe also produce VSLs, lead lists, sales funnels and provide metrics and analysis for our clients.',
			'company_linkedin_profile_url': 'https://www.linkedin.com/company/lead-engine/'
		}, {
			'title': 'Real Estate Broker Associate',
			'company': 'eXp Realty',
			'ends_at': {
				'day': 31,
				'year': 2020,
				'month': 1
			},
			'location': 'Sioux Falls, South Dakota Area',
			'logo_url': 'https://media-exp2.licdn.com/dms/image/C560BAQHAw_11TJy26Q/company-logo_400_400/0/1654095988056?e=1663804800&v=beta&t=DtpOh6_2Vv-XECtBBTxJqrWcNxF45Nm2SCuDKkQnS0M',
			'starts_at': {
				'day': 1,
				'year': 2019,
				'month': 1
			},
			'description': 'I assisted clients purchasing and selling residential real estate in the Sioux Falls, SD market.',
			'company_linkedin_profile_url': 'https://www.linkedin.com/company/exp-realty/'
		}, {
			'title': 'Renaissance Man',
			'company': 'Pipco Consulting',
			'ends_at': None,
			'location': 'Sioux Falls, SD ',
			'logo_url': None,
			'starts_at': {
				'day': 1,
				'year': 2021,
				'month': 12
			},
			'description': None,
			'company_linkedin_profile_url': None
		}, {
			'title': 'Real Estate Broker Associate',
			'company': 'Don Dunham III Real Estate',
			'ends_at': {
				'day': 31,
				'year': 2019,
				'month': 1
			},
			'location': 'Sioux Falls, South Dakota Area',
			'logo_url': None,
			'starts_at': {
				'day': 1,
				'year': 2018,
				'month': 8
			},
			'description': None,
			'company_linkedin_profile_url': None
		}, {
			'title': 'Senior Design Consultant',
			'company': 'Budget Blinds of Sioux Falls',
			'ends_at': {
				'day': 31,
				'year': 2018,
				'month': 5
			},
			'location': 'Sioux Falls, SD',
			'logo_url': None,
			'starts_at': {
				'day': 1,
				'year': 2010,
				'month': 4
			},
			'description': 'I was responsible for sales-based quota attainment of approximately $1M in revenue per year for a locally owned but nationally recognized window coverings franchise, Budget Blinds. \nA significant portion of my time day-to-day was in-home selling, along with responding to RFPs from general contractors/builders, as well as giving estimates for window coverings based on architectural renderings and plans provided by homeowners. \nI also had extensive involvement in our local Home Builders Association and was on the Parade of Homes Committee and the Remodeling Council. \nRelationship building was also very important in this position-I spent much time & effort building rapport with local builders to develop business.',
			'company_linkedin_profile_url': None
		}, {
			'title': 'Indirect Account Manager',
			'company': 'Alltel',
			'ends_at': {
				'day': 30,
				'year': 2010,
				'month': 4
			},
			'location': 'Sioux Falls, SD',
			'logo_url': 'https://media-exp2.licdn.com/dms/image/C560BAQGOBCSDqc5pjw/company-logo_400_400/0/1519856401038?e=1663804800&v=beta&t=pA8fROhYwxMPFo-vLoz22B-O_KyAXvB-awlMOckVXJU',
			'starts_at': {
				'day': 1,
				'year': 2000,
				'month': 7
			},
			'description': 'I held several positions during my tenure at Alltel, most recently as an Indirect Account Manager. I was responsible for the Indirect Distribution in Southeast SD and Northwest IA. This included multiple local agents, along with nation retail clients including Best Buy, Walmart and Radio Shack. \nExtensive in-store/classroom training was a substantive portion of my position. I also was responsible for recruitment of new agents, management of existing agents, and termination of underperforming agents. I also helped agent owners/management plan and execute outside events leading to incremental sales.',
			'company_linkedin_profile_url': 'https://www.linkedin.com/company/alltelwireless-/'
		}],
		'certifications': [],
		'volunteer_work': [{
			'cause': None,
			'title': 'Music team volunteer',
			'company': 'Celebrate Community Church',
			'ends_at': {
				'day': 31,
				'year': 2019,
				'month': 10
			},
			'logo_url': None,
			'starts_at': {
				'day': 1,
				'year': 2012,
				'month': 10
			},
			'description': 'I played electric & acoustic guitar/bass and sang lead vocals at Celebrate Church in Brandon, SD.\nThe position averaged approximately 4 to 8 hours a month depending on scheduling.',
			'company_linkedin_profile_url': None
		}],
		'recommendations': ["Brandon Kathman\n\n\n\nI rarely come across real talent who stand out like Eric. I had the pleasure of managing Eric at a Digital Marketing startup. Eric's ability to handle multiple projects and his energy was unlike any I’ve seen before. He was able to make a dramatic increase in the productivity level of our company. No matter what was thrown at him, Eric made sure every project was done to the highest level. As a team member or a leader, Eric earns my highest recommendation.", "Dan Rolle\n\n\n\nIt is my great pleasure to recommend Eric Anderson based on our many years working together in Account Management and Distribution in the technology and communication space.  I could write a book about what Eric would bring to your company, so I will get to the point. \n\n1.) Eric is excellent at mentoring and strategy.  He is never afraid to provide specific and direct feedback that will help his colleagues both personally and professionally. Eric has given me some of the most straight-forward and beneficial feedback in my life.  \n\n2.) Eric is always willing to share, and to help other with and advice.  Time and time again, though Eric was responsible for creating an excellent best-practice, he was also more than willing to share and help.  Specifically, Eric helped me and dozens of others grow our distribution channels, boost profit and improve end dealer (client) experience.  \n\n3.) Eric is one of the most respected account managers in the industry that we worked in.  In technology and communication, relationships matter and results are critical.  Eric helped his dealer network grow at a crucial time in the info-tech space.  There are unquestionably businesses in his region that are in business today only because Eric was able to give them business critical strategy. \n\n4.) Eric brings humor and fun to the workplace.  He knows how to be the consummate professional and represent a brand, yet also understands that work should be a place you enjoy.  He is exceptional in this regard.  Want your customers to love your brand based on relationship?  Don't pass up on Eric.  \n\n5.) Eric knows how to balance results and culture.  He is very aware that his role in an organization is to help drive success.  He also knows that you have to do that the right way. Eric can balance results and culture like few I have met.  \n\nAnyone with any further questions about our time working together is absolutely welcome to contact me directly. ", 'Doug Penniston\n\n\n\nEric and I worked with an indirect sales team or dealer network for Cellular One.  Eric was essential to our success in this region.  He worked directly with the dealer employees training them on Cellular One products and services.  At the same time he was a mentor and motivator to those same employees.  Eric excelled in both roles but he particularly shined in the training aspect of the position.  He made it his goal to make sure the employees in the stores he was assigned to knew our product well.  This lead to both increased sales decreased customer churn.\r\n\r\nI would highly recommend Eric for roles that included training and motivation of other employees.', 'Dustin Sedars\n\n\n\nEric is a very energetic person that brings passion to his job.  He brings a lot of enthusiasm to his team, and he is someone that has experience working with many different individuals.  Eric prides himself on knowledge of what he does, and he pushes himself to make sure he can be seen as a knowledge expert in his field.  He enjoys new challenges and is comfortable in an environment of change.  He is very open to new suggestions and ideas, and during his time on my team he built very strong relationships that continue to this day.  He is someone that is always wiling to volunteer and step up to take on assignments.'],
		'country_full_name': 'United States of America',
		'public_identifier': 'uptics',
		'people_also_viewed': [{
			'link': 'https://www.linkedin.com/in/thejasoncraig',
			'name': 'Jason Craig',
			'summary': 'Changing customers into Brand Advocates',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/adam-hamilton-066b57233',
			'name': 'Adam Hamilton',
			'summary': 'Design Engineer at Raptor Civil Engineering',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/wayne-craig-29744046',
			'name': 'Wayne Craig',
			'summary': '--Retired Operations Superintendent',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/russell-wayne-craig-4a7295154',
			'name': 'Russell Wayne Craig',
			'summary': 'Owner at OM28 GROUP',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/wayne-craig',
			'name': 'Wayne Craig',
			'summary': 'Retired',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/wayneacraig2nd',
			'name': 'Wayne Craig',
			'summary': 'Walmart Merchandise Supervisor',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/sean-larsen-732b73169',
			'name': 'Sean Larsen',
			'summary': 'Real Estate Advisor at eXp Realty',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/wayne-craig-bb9ba815',
			'name': 'Wayne Craig',
			'summary': 'Regional Vice President at Pedross USA',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/wayne-craig-2a686118b',
			'name': 'Wayne Craig',
			'summary': '--',
			'location': None
		}, {
			'link': 'https://www.linkedin.com/in/wayne-craig-9a64b617',
			'name': 'Wayne Craig',
			'summary': 'Director at Deloitte',
			'location': None
		}],
		'accomplishment_courses': [],
		'accomplishment_patents': [],
		'accomplishment_projects': [],
		'similarly_named_profiles': [],
		'accomplishment_test_scores': [],
		'background_cover_image_url': None,
		'accomplishment_publications': [],
		'accomplishment_honors_awards': [{
			'title': 'Show Us Your Best ',
			'issuer': 'Alltel',
			'issued_on': {
				'day': 1,
				'year': 2009,
				'month': 3
			},
			'description': 'I won this award via a nomination by my direct supervisor at the time, Dustin Sedars. \n'
		}, {
			'title': 'Superstar Challenge Awards Winner',
			'issuer': 'Cellular One/Alltel ',
			'issued_on': {
				'day': 1,
				'year': 2001,
				'month': 4
			},
			'description': 'Sales-based award winner. '
		}],
		'accomplishment_organisations': []
	},
	'enriched_company_data': {
		'hq': {
			'city': 'Minneapolis',
			'is_hq': True,
			'state': 'MN',
			'line_1': 'Remote',
			'country': 'US',
			'postal_code': None
		},
		'name': 'Uptics ',
		'tagline': 'Meet Uptics. The simple Sales Automation CRM for small businesses that sells 24/7 so you don’t have to.',
		'updates': [{
			'text': 'Ever have a sales meeting with a prospect and completely forget to follow up?\n \nThen like a year later you randomly remembered.\n\nImagine…\n\n🔥 Your lead nurturing completely automated.\n \n🔥 Checking in with your customers without lifting a finger.\n \n🔥 Staying out of the "Friendzone" with prospects by putting your "Maybe’s" on autopilot.\n \n🔥 Still having a chance with prospects who told you "Not Interested"...So You\'re Telling Me There\'s A Chance!\n \n🔥 Launching strategic referral partner campaigns to build new relationships.\n \n🔥 And subsidizing your deal flow using cold campaigns.\n \nAll of this leading to...\n\n📅 Seeing your calendar packed with qualified sales meetings with prospects.\n \n🤝 Adding new customers consistently.\n \n💰 Monthly revenues climbing predictably.\n \nHow would that feel?\n\nYou can do all of that by signing up for a free trial of Uptics Sales Automation: https://uptics.io.\n\nUptics is a lightweight, easy to use,  software that helps you automate all the manual, boring sales stuff so you can focus on things that matter...taking care of customers and closing sales.\n\n#sales \n#salesautomation \n#salesdevelopment \n#salesmanagement \n#salesenablement',
			'image': 'https://media-exp1.licdn.com/dms/image/C5605AQEXndIdEqs1Bg/videocover-high/0/1597961436044?e=2147483647&v=beta&t=8cZh0EiFVmjI6aGIahDH2ahMPYBUO_94HQx5ncIwx-o',
			'posted_on': None,
			'total_likes': 6,
			'article_link': None
		}],
		'website': 'http://www.uptics.io',
		'industry': 'Computer Software',
		'locations': [{
			'city': 'Minneapolis',
			'is_hq': True,
			'state': 'MN',
			'line_1': 'Remote',
			'country': 'US',
			'postal_code': None
		}],
		'search_id': '64882086',
		'description': 'Meet the modern sales management platform that combines the power of CRM, cold outreach, and sales automation into one tool. Uptics is the go to software for sales focused companies to manage all your work in one software, so you can maximize time while making the largest impact.',
		'company_size': [2, 10],
		'company_type': 'PRIVATELY_HELD',
		'founded_year': 2020,
		'specialities': [''],
		'follower_count': 3023,
		'similar_companies': [{
			'link': 'https://www.linkedin.com/company/uptycs',
			'name': 'Uptycs',
			'industry': 'Computer and Network Security',
			'location': 'Waltham, MA'
		}, {
			'link': 'https://in.linkedin.com/company/jashds',
			'name': 'Jash Data Sciences',
			'industry': 'Software Development',
			'location': 'Pune, Maharashtra'
		}, {
			'link': 'https://in.linkedin.com/company/sat-n-paper',
			'name': 'SAT n paper',
			'industry': 'Education Administration Programs',
			'location': 'NOIDA, Uttar Pradesh'
		}, {
			'link': 'https://www.linkedin.com/company/weareuplers',
			'name': 'Uplers',
			'industry': 'IT Services and IT Consulting',
			'location': 'San Diego, CA'
		}, {
			'link': 'https://www.linkedin.com/company/lead-engine',
			'name': 'Lead Engine',
			'industry': 'Marketing Services',
			'location': 'Minneapolis | St. Paul, Minnesota'
		}, {
			'link': 'https://in.linkedin.com/company/hashedin',
			'name': 'HashedIn',
			'industry': 'IT Services and IT Consulting',
			'location': 'Bangalore, Karnataka'
		}, {
			'link': 'https://in.linkedin.com/company/graphyapp',
			'name': 'Graphy',
			'industry': 'E-Learning Providers',
			'location': 'Bengaluru, Karnataka'
		}, {
			'link': 'https://au.linkedin.com/company/uptickhq',
			'name': 'Uptick',
			'industry': 'Software Development',
			'location': 'Fitzroy, Victoria'
		}, {
			'link': 'https://in.linkedin.com/company/tata-consultancy-services',
			'name': 'Tata Consultancy Services',
			'industry': 'IT Services and IT Consulting',
			'location': 'Mumbai, Maharashtra'
		}, {
			'link': 'https://www.linkedin.com/company/splashtop',
			'name': 'Splashtop Inc.',
			'industry': 'Software Development',
			'location': 'Cupertino, California'
		}],
		'universal_name_id': 'uptics',
		'linkedin_internal_id': '64882086',
		'company_size_on_linkedin': 6
	},
	'created_date': '2021-06-27T20:03:05Z'
}
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/contact/<contact-id>/' \
--header 'Authorization: API-KEY' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Python" %}

```
import requests
import json

url = f"https://app.copyfactory.io/api/v2/contact/{contact_id}/"

headers = {
  'Authorization': 'API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}


# Search contacts

You can search for contacts through various properties and conditions.&#x20;

You can pass in a list of conditions to hyper-filter the results. Let's take a look at an example to understand how it works:

```
condition1 = [{'property': 'email', 'condition': 'Is', 'value': 'demo@cf.io'}]
condition2 = [{'property': 'email', 'condition': 'Is', 'value': 'uno@dos.com'}]
time = [{'property': "created_timestamp", 'condition': "Exactly", 'value': "0"}]
enriched = [{'property': "is_enriched", 'condition': 'Is', 'value': True}]
conditions = condition1 + condition2 + time + enriched
```

When you pass in conditions that have the same property name and condition value we convert them into 'OR' statements. Under our example above this would return contacts that have the email '<demo@cf.io>' OR '<uno@dos.com>'.

Finally, we apply our third condition to only look for contacts added today. You can read the condition as being "Get me all contacts that were created 0 days ago".

Below are the property names you can filter on and the conditions you can apply.

<table><thead><tr><th align="center">Property name</th><th width="150">Description</th><th>Available conditions</th></tr></thead><tbody><tr><td align="center">sequence__id (int)</td><td>The ID of a sequence in Copyfactory.</td><td>"Is", "Is not"</td></tr><tr><td align="center">email (str)</td><td>The email of the contact</td><td>"Is", "Is not", "Contains", "Does not contain"</td></tr><tr><td align="center">premise_<em>ids_</em>used (str)</td><td>The ID of a sentence premise that was generated for the contact.<br><br>This is NOT the Id of the premise but the internal ID. The internal ID can be retrieved using the premises endpoint and looks like "7da3d316-aadf-4379-b588-7459395c67c7"</td><td>"Is", "Is not"</td></tr><tr><td align="center">created_timestamp (int)</td><td>The timestamp of when the contact was created. We let you filter based on number of days since created.</td><td>"More than", "Exactly", "Less than"</td></tr><tr><td align="center">updated_timestamp (int)</td><td>The timestamp of when the contact was updated. We let you filter based on number of days since created. So a value of '0' would be today.</td><td>"More than", "Exactly", "Less than"</td></tr><tr><td align="center">last_<em>synced_</em>timestamp (int)</td><td>The timestamp of when the contact was synced to one of your integrations. We let you filter based on number of days since created. So a value of '0' would be today.</td><td>"More than", "Exactly", "Less than"</td></tr><tr><td align="center">is_enriched (bool)</td><td>A True/False of if the contact has been enriched.</td><td>"Is", "Is not"</td></tr></tbody></table>

## Search contacts

<mark style="color:green;">`POST`</mark> `https://app.copyfactory.io/api/v2/contact/search/`

Searches for contacts

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Copyfactory API key |

#### Request Body

| Name       | Type  | Description                                                                |
| ---------- | ----- | -------------------------------------------------------------------------- |
| conditions | array | List of objects containing the conditions you want to apply to the search. |
| page\_size | int   | The size of the page you want returned. Default is 100.                    |
| page       | int   | The page number you want returned to you. Default is 1.                    |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
	'contacts': [{
		'id': 6,
		'email': 'demo@cf.io',
		'custom_fields': {
			'post_author': '1',
			'post_content': '1',
		},
		'sentence_fields': {
			'snip1': 'We integrate with a lot of tools',
			'snip2': 'Including Pipedrive, CloseCRM, Hubspot and sales automation tools.'
		},
		'sequence_name': 'Seq',
		'linked_in_handle': 'handle.mm',
		'enriched_contact_data': {
			'city': 'Sioux Falls',
			'state': 'South Dakota',
			'groups': [],
			'country': 'US',
			'summary': 'Experienced Sales Specialist with a demonstrated history of growing long-term relationships. Skilled in Outbound & Inbound Sales, Management, Customer Experience, Digital Marketing, and Training, Social Media, and CRM usage, including personal video engagement and email automation/3rd party API integration.',
			'articles': [],
			'headline': None,
			'education': [{
				'school': 'South Dakota State University',
				'ends_at': {
					'day': 31,
					'year': 1999,
					'month': 12
				},
				'logo_url': 'https://media-exp2.licdn.com/dms/image/C510BAQEzCqmfFDgExg/company-logo_400_400/0/1519856534459?e=1663804800&v=beta&t=-K57aHPSkKTN7Lly0CHoFLLiWJEXZ6Geme73hQMRom4',
				'starts_at': {
					'day': 1,
					'year': 1995,
					'month': 1
				},
				'degree_name': 'B.S.',
				'description': None,
				'field_of_study': 'Geography',
				'school_linkedin_profile_url': None
			}],
			'full_name': 'Eric Anderson',
			'languages': [],
			'last_name': 'Anderson',
			'activities': [],
			'first_name': 'Eric',
			'occupation': 'Sales Manager at Uptics ',
			'connections': None,
			'experiences': [{
				'title': 'Sales Manager',
				'company': 'Uptics ',
				'ends_at': None,
				'location': 'Sioux Falls, SD ',
				'logo_url': 'https://media-exp2.licdn.com/dms/image/C4E0BAQF1pPNQ2vllXQ/company-logo_400_400/0/1641413912350?e=1663804800&v=beta&t=njTPLoe3ajrtoHIDYIyEzYxjeMb7ihjRIZSGdz_4RKo',
				'starts_at': {
					'day': 1,
					'year': 2022,
					'month': 6
				},
				'description': None,
				'company_linkedin_profile_url': 'https://www.linkedin.com/company/uptics/'
			}, {
				'title': 'Account Manager',
				'company': 'Fully Promoted Sioux Falls (formerly EmbroidMe)',
				'ends_at': {
					'day': 31,
					'year': 2022,
					'month': 1
				},
				'location': 'Sioux Falls, South Dakota, United States',
				'logo_url': 'https://media-exp2.licdn.com/dms/image/C4D0BAQFvvmku28swVA/company-logo_400_400/0/1519921269861?e=1663804800&v=beta&t=t9U9qyJTddtXMGQppGp1JlmfbH5dzTZtlRVv5n4-zAg',
				'starts_at': {
					'day': 1,
					'year': 2021,
					'month': 6
				},
				'description': 'Fully Promoted Sioux Falls is the leading promotional company in the marketing world. We help other businesses to grow by promoting them through embroidery, screen printing, direct garment printing, transfers and promotional items.',
				'company_linkedin_profile_url': 'https://www.linkedin.com/company/fully-promoted-sioux-falls-formerly-embroidme-/'
			}, {
				'title': 'Sales ',
				'company': 'Building Start',
				'ends_at': {
					'day': 28,
					'year': 2021,
					'month': 2
				},
				'location': 'Sioux Falls, South Dakota, United States',
				'logo_url': 'https://media-exp2.licdn.com/dms/image/C560BAQHlSNMOb3sdKg/company-logo_400_400/0/1519893965106?e=1663804800&v=beta&t=q3bgCIWRfH3wBVTxHkghEYIeupy8VRRJxPTvZQqn7eo',
				'starts_at': {
					'day': 1,
					'year': 2020,
					'month': 8
				},
				'description': 'Building Start is a SaaS provider that enables anyone who uses large checklists or does extensive field data documentation to get rid of antiquated methods such as using paper or Excel. I help organizations improve collaboration, greatly enhance reporting capabilities, document issues/deficiencies/issues with our field tools, and add to the bottom line. Our platform is proprietary and has many case studies showing direct impact made by transitioning to our software.',
				'company_linkedin_profile_url': 'https://www.linkedin.com/company/building-start/'
			}, {
				'title': 'Sales Engineer',
				'company': 'Lead Engine Sales & Marketing ',
				'ends_at': {
					'day': 31,
					'year': 2019,
					'month': 10
				},
				'location': 'Brandon, SD',
				'logo_url': 'https://media-exp2.licdn.com/dms/image/C4E0BAQFYxW7ErhskNA/company-logo_400_400/0/1578886753053?e=1663804800&v=beta&t=DIfZiRrx4yI3-0lvA0gDRCBOeNdo7VvZ-27jjeAG66M',
				'starts_at': {
					'day': 1,
					'year': 2019,
					'month': 3
				},
				'description': 'I help people in the technology and consulting sectors broker meetings with qualified leads by utilizing advertising campaigns and high-quality prospecting techniques. \nWe also produce VSLs, lead lists, sales funnels and provide metrics and analysis for our clients.',
				'company_linkedin_profile_url': 'https://www.linkedin.com/company/lead-engine/'
			}, {
				'title': 'Real Estate Broker Associate',
				'company': 'eXp Realty',
				'ends_at': {
					'day': 31,
					'year': 2020,
					'month': 1
				},
				'location': 'Sioux Falls, South Dakota Area',
				'logo_url': 'https://media-exp2.licdn.com/dms/image/C560BAQHAw_11TJy26Q/company-logo_400_400/0/1654095988056?e=1663804800&v=beta&t=DtpOh6_2Vv-XECtBBTxJqrWcNxF45Nm2SCuDKkQnS0M',
				'starts_at': {
					'day': 1,
					'year': 2019,
					'month': 1
				},
				'description': 'I assisted clients purchasing and selling residential real estate in the Sioux Falls, SD market.',
				'company_linkedin_profile_url': 'https://www.linkedin.com/company/exp-realty/'
			}, {
				'title': 'Renaissance Man',
				'company': 'Pipco Consulting',
				'ends_at': None,
				'location': 'Sioux Falls, SD ',
				'logo_url': None,
				'starts_at': {
					'day': 1,
					'year': 2021,
					'month': 12
				},
				'description': None,
				'company_linkedin_profile_url': None
			}, {
				'title': 'Real Estate Broker Associate',
				'company': 'Don Dunham III Real Estate',
				'ends_at': {
					'day': 31,
					'year': 2019,
					'month': 1
				},
				'location': 'Sioux Falls, South Dakota Area',
				'logo_url': None,
				'starts_at': {
					'day': 1,
					'year': 2018,
					'month': 8
				},
				'description': None,
				'company_linkedin_profile_url': None
			}, {
				'title': 'Senior Design Consultant',
				'company': 'Budget Blinds of Sioux Falls',
				'ends_at': {
					'day': 31,
					'year': 2018,
					'month': 5
				},
				'location': 'Sioux Falls, SD',
				'logo_url': None,
				'starts_at': {
					'day': 1,
					'year': 2010,
					'month': 4
				},
				'description': 'I was responsible for sales-based quota attainment of approximately $1M in revenue per year for a locally owned but nationally recognized window coverings franchise, Budget Blinds. \nA significant portion of my time day-to-day was in-home selling, along with responding to RFPs from general contractors/builders, as well as giving estimates for window coverings based on architectural renderings and plans provided by homeowners. \nI also had extensive involvement in our local Home Builders Association and was on the Parade of Homes Committee and the Remodeling Council. \nRelationship building was also very important in this position-I spent much time & effort building rapport with local builders to develop business.',
				'company_linkedin_profile_url': None
			}, {
				'title': 'Indirect Account Manager',
				'company': 'Alltel',
				'ends_at': {
					'day': 30,
					'year': 2010,
					'month': 4
				},
				'location': 'Sioux Falls, SD',
				'logo_url': 'https://media-exp2.licdn.com/dms/image/C560BAQGOBCSDqc5pjw/company-logo_400_400/0/1519856401038?e=1663804800&v=beta&t=pA8fROhYwxMPFo-vLoz22B-O_KyAXvB-awlMOckVXJU',
				'starts_at': {
					'day': 1,
					'year': 2000,
					'month': 7
				},
				'description': 'I held several positions during my tenure at Alltel, most recently as an Indirect Account Manager. I was responsible for the Indirect Distribution in Southeast SD and Northwest IA. This included multiple local agents, along with nation retail clients including Best Buy, Walmart and Radio Shack. \nExtensive in-store/classroom training was a substantive portion of my position. I also was responsible for recruitment of new agents, management of existing agents, and termination of underperforming agents. I also helped agent owners/management plan and execute outside events leading to incremental sales.',
				'company_linkedin_profile_url': 'https://www.linkedin.com/company/alltelwireless-/'
			}],
			'certifications': [],
			'volunteer_work': [{
				'cause': None,
				'title': 'Music team volunteer',
				'company': 'Celebrate Community Church',
				'ends_at': {
					'day': 31,
					'year': 2019,
					'month': 10
				},
				'logo_url': None,
				'starts_at': {
					'day': 1,
					'year': 2012,
					'month': 10
				},
				'description': 'I played electric & acoustic guitar/bass and sang lead vocals at Celebrate Church in Brandon, SD.\nThe position averaged approximately 4 to 8 hours a month depending on scheduling.',
				'company_linkedin_profile_url': None
			}],
			'recommendations': ["Brandon Kathman\n\n\n\nI rarely come across real talent who stand out like Eric. I had the pleasure of managing Eric at a Digital Marketing startup. Eric's ability to handle multiple projects and his energy was unlike any I’ve seen before. He was able to make a dramatic increase in the productivity level of our company. No matter what was thrown at him, Eric made sure every project was done to the highest level. As a team member or a leader, Eric earns my highest recommendation.", "Dan Rolle\n\n\n\nIt is my great pleasure to recommend Eric Anderson based on our many years working together in Account Management and Distribution in the technology and communication space.  I could write a book about what Eric would bring to your company, so I will get to the point. \n\n1.) Eric is excellent at mentoring and strategy.  He is never afraid to provide specific and direct feedback that will help his colleagues both personally and professionally. Eric has given me some of the most straight-forward and beneficial feedback in my life.  \n\n2.) Eric is always willing to share, and to help other with and advice.  Time and time again, though Eric was responsible for creating an excellent best-practice, he was also more than willing to share and help.  Specifically, Eric helped me and dozens of others grow our distribution channels, boost profit and improve end dealer (client) experience.  \n\n3.) Eric is one of the most respected account managers in the industry that we worked in.  In technology and communication, relationships matter and results are critical.  Eric helped his dealer network grow at a crucial time in the info-tech space.  There are unquestionably businesses in his region that are in business today only because Eric was able to give them business critical strategy. \n\n4.) Eric brings humor and fun to the workplace.  He knows how to be the consummate professional and represent a brand, yet also understands that work should be a place you enjoy.  He is exceptional in this regard.  Want your customers to love your brand based on relationship?  Don't pass up on Eric.  \n\n5.) Eric knows how to balance results and culture.  He is very aware that his role in an organization is to help drive success.  He also knows that you have to do that the right way. Eric can balance results and culture like few I have met.  \n\nAnyone with any further questions about our time working together is absolutely welcome to contact me directly. ", 'Doug Penniston\n\n\n\nEric and I worked with an indirect sales team or dealer network for Cellular One.  Eric was essential to our success in this region.  He worked directly with the dealer employees training them on Cellular One products and services.  At the same time he was a mentor and motivator to those same employees.  Eric excelled in both roles but he particularly shined in the training aspect of the position.  He made it his goal to make sure the employees in the stores he was assigned to knew our product well.  This lead to both increased sales decreased customer churn.\r\n\r\nI would highly recommend Eric for roles that included training and motivation of other employees.', 'Dustin Sedars\n\n\n\nEric is a very energetic person that brings passion to his job.  He brings a lot of enthusiasm to his team, and he is someone that has experience working with many different individuals.  Eric prides himself on knowledge of what he does, and he pushes himself to make sure he can be seen as a knowledge expert in his field.  He enjoys new challenges and is comfortable in an environment of change.  He is very open to new suggestions and ideas, and during his time on my team he built very strong relationships that continue to this day.  He is someone that is always wiling to volunteer and step up to take on assignments.'],
			'country_full_name': 'United States of America',
			'public_identifier': 'uptics',
			'people_also_viewed': [{
				'link': 'https://www.linkedin.com/in/thejasoncraig',
				'name': 'Jason Craig',
				'summary': 'Changing customers into Brand Advocates',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/adam-hamilton-066b57233',
				'name': 'Adam Hamilton',
				'summary': 'Design Engineer at Raptor Civil Engineering',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/wayne-craig-29744046',
				'name': 'Wayne Craig',
				'summary': '--Retired Operations Superintendent',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/russell-wayne-craig-4a7295154',
				'name': 'Russell Wayne Craig',
				'summary': 'Owner at OM28 GROUP',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/wayne-craig',
				'name': 'Wayne Craig',
				'summary': 'Retired',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/wayneacraig2nd',
				'name': 'Wayne Craig',
				'summary': 'Walmart Merchandise Supervisor',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/sean-larsen-732b73169',
				'name': 'Sean Larsen',
				'summary': 'Real Estate Advisor at eXp Realty',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/wayne-craig-bb9ba815',
				'name': 'Wayne Craig',
				'summary': 'Regional Vice President at Pedross USA',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/wayne-craig-2a686118b',
				'name': 'Wayne Craig',
				'summary': '--',
				'location': None
			}, {
				'link': 'https://www.linkedin.com/in/wayne-craig-9a64b617',
				'name': 'Wayne Craig',
				'summary': 'Director at Deloitte',
				'location': None
			}],
			'accomplishment_courses': [],
			'accomplishment_patents': [],
			'accomplishment_projects': [],
			'similarly_named_profiles': [],
			'accomplishment_test_scores': [],
			'background_cover_image_url': None,
			'accomplishment_publications': [],
			'accomplishment_honors_awards': [{
				'title': 'Show Us Your Best ',
				'issuer': 'Alltel',
				'issued_on': {
					'day': 1,
					'year': 2009,
					'month': 3
				},
				'description': 'I won this award via a nomination by my direct supervisor at the time, Dustin Sedars. \n'
			}, {
				'title': 'Superstar Challenge Awards Winner',
				'issuer': 'Cellular One/Alltel ',
				'issued_on': {
					'day': 1,
					'year': 2001,
					'month': 4
				},
				'description': 'Sales-based award winner. '
			}],
			'accomplishment_organisations': []
		},
		'enriched_company_data': {
			'hq': {
				'city': 'Minneapolis',
				'is_hq': True,
				'state': 'MN',
				'line_1': 'Remote',
				'country': 'US',
				'postal_code': None
			},
			'name': 'Uptics ',
			'tagline': 'Meet Uptics. The simple Sales Automation CRM for small businesses that sells 24/7 so you don’t have to.',
			'updates': [{
				'text': 'Ever have a sales meeting with a prospect and completely forget to follow up?\n \nThen like a year later you randomly remembered.\n\nImagine…\n\n🔥 Your lead nurturing completely automated.\n \n🔥 Checking in with your customers without lifting a finger.\n \n🔥 Staying out of the "Friendzone" with prospects by putting your "Maybe’s" on autopilot.\n \n🔥 Still having a chance with prospects who told you "Not Interested"...So You\'re Telling Me There\'s A Chance!\n \n🔥 Launching strategic referral partner campaigns to build new relationships.\n \n🔥 And subsidizing your deal flow using cold campaigns.\n \nAll of this leading to...\n\n📅 Seeing your calendar packed with qualified sales meetings with prospects.\n \n🤝 Adding new customers consistently.\n \n💰 Monthly revenues climbing predictably.\n \nHow would that feel?\n\nYou can do all of that by signing up for a free trial of Uptics Sales Automation: https://uptics.io.\n\nUptics is a lightweight, easy to use,  software that helps you automate all the manual, boring sales stuff so you can focus on things that matter...taking care of customers and closing sales.\n\n#sales \n#salesautomation \n#salesdevelopment \n#salesmanagement \n#salesenablement',
				'image': 'https://media-exp1.licdn.com/dms/image/C5605AQEXndIdEqs1Bg/videocover-high/0/1597961436044?e=2147483647&v=beta&t=8cZh0EiFVmjI6aGIahDH2ahMPYBUO_94HQx5ncIwx-o',
				'posted_on': None,
				'total_likes': 6,
				'article_link': None
			}],
			'website': 'http://www.uptics.io',
			'industry': 'Computer Software',
			'locations': [{
				'city': 'Minneapolis',
				'is_hq': True,
				'state': 'MN',
				'line_1': 'Remote',
				'country': 'US',
				'postal_code': None
			}],
			'search_id': '64882086',
			'description': 'Meet the modern sales management platform that combines the power of CRM, cold outreach, and sales automation into one tool. Uptics is the go to software for sales focused companies to manage all your work in one software, so you can maximize time while making the largest impact.',
			'company_size': [2, 10],
			'company_type': 'PRIVATELY_HELD',
			'founded_year': 2020,
			'specialities': [''],
			'follower_count': 3023,
			'similar_companies': [{
				'link': 'https://www.linkedin.com/company/uptycs',
				'name': 'Uptycs',
				'industry': 'Computer and Network Security',
				'location': 'Waltham, MA'
			}, {
				'link': 'https://in.linkedin.com/company/jashds',
				'name': 'Jash Data Sciences',
				'industry': 'Software Development',
				'location': 'Pune, Maharashtra'
			}, {
				'link': 'https://in.linkedin.com/company/sat-n-paper',
				'name': 'SAT n paper',
				'industry': 'Education Administration Programs',
				'location': 'NOIDA, Uttar Pradesh'
			}, {
				'link': 'https://www.linkedin.com/company/weareuplers',
				'name': 'Uplers',
				'industry': 'IT Services and IT Consulting',
				'location': 'San Diego, CA'
			}, {
				'link': 'https://www.linkedin.com/company/lead-engine',
				'name': 'Lead Engine',
				'industry': 'Marketing Services',
				'location': 'Minneapolis | St. Paul, Minnesota'
			}, {
				'link': 'https://in.linkedin.com/company/hashedin',
				'name': 'HashedIn',
				'industry': 'IT Services and IT Consulting',
				'location': 'Bangalore, Karnataka'
			}, {
				'link': 'https://in.linkedin.com/company/graphyapp',
				'name': 'Graphy',
				'industry': 'E-Learning Providers',
				'location': 'Bengaluru, Karnataka'
			}, {
				'link': 'https://au.linkedin.com/company/uptickhq',
				'name': 'Uptick',
				'industry': 'Software Development',
				'location': 'Fitzroy, Victoria'
			}, {
				'link': 'https://in.linkedin.com/company/tata-consultancy-services',
				'name': 'Tata Consultancy Services',
				'industry': 'IT Services and IT Consulting',
				'location': 'Mumbai, Maharashtra'
			}, {
				'link': 'https://www.linkedin.com/company/splashtop',
				'name': 'Splashtop Inc.',
				'industry': 'Software Development',
				'location': 'Cupertino, California'
			}],
			'universal_name_id': 'uptics',
			'linkedin_internal_id': '64882086',
			'company_size_on_linkedin': 6
		},
		'created_date': '2022-06-27T20:03:05Z'
	}],
	'pagination': {
		'total_contacts': 1,
		'page': 1,
		'total_pages': 1,
		'page_size': 200
	}
}
```

{% endtab %}
{% endtabs %}


# Profiles

You can create multiple profiles in Copyfactory manage either clients or users. Your global API key allows you to easily filter and work with all of your profiles.

{% content-ref url="/pages/EshrOuVN3YsStSkA1L8b" %}
[The profile object](/api/profiles/the-profile-object)
{% endcontent-ref %}

{% content-ref url="/pages/FKBvEY9g6Oi83pe6PRqX" %}
[Get a profile](/api/profiles/get-a-profile)
{% endcontent-ref %}

{% content-ref url="/pages/9A5uZGM3H7wHKGXLErqC" %}
[List all profiles](/api/profiles/list-all-profiles)
{% endcontent-ref %}


# The profile object

| Attribute          | Type    | Description                                        |
| ------------------ | ------- | -------------------------------------------------- |
| id                 | int     | Unique identified for the profile.                 |
| profile\_name      | string  | The name of the profile.                           |
| profile\_domain    | string  | The name of the profile name.                      |
| is\_active         | boolean | The status of the profile.                         |
| current\_tool      | string  | The current sales tool being used by this profile. |
| created\_timestamp | string  | Timestamp of when profile was created.             |


# Get a profile

## Get a profile object by ID

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/profiles/get/`

Retrieves the details of an existing profile. Supply the unique profile ID and the API will return the corresponding project information.

#### Query Parameters

| Name        | Type | Description           |
| ----------- | ---- | --------------------- |
| profile\_id | int  | The unique profile ID |

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Your Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
		"data": {
		"id": 1,
		"profile_name": "Copyfactory",
		"profile_domain": "copyfactory.io",
		"is_active": true,
		"current_tool": "Apollo",
		"created_timestamp": "2021-05-18T21:04:26Z"
	}
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/profiles/get?profile_id=PROFILE-ID/' \
--header 'Authorization: API-KEY'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://app.copyfactory.io/api/v2/profiles/get/"

payload={}

params = (('profile_id', 'PROFILE-ID'),)

headers = {
  'Authorization': 'API-KEY'
}

response = requests.request("GET", url, headers=headers,params=params, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}


# List all profiles

## Will fetch a list of profiles.

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/profiles/list/`

An array with all profiles. Each entry in the array is a separate profile object.

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Your Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
	"data": [{
		"id": 1,
		"profile_name": "Copyfactory",
		"profile_domain": "copyfactory.io",
		"is_active": true,
		"current_tool": "Apollo",
		"created_timestamp": "2021-05-18T21:04:26Z"
	}]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/profiles/list/' \
--header 'Authorization: API-KEY'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://app.copyfactory.io/api/v2/profiles/list/"

headers = {
  'Authorization': 'API-KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

{% endtab %}
{% endtabs %}


# Premises

{% content-ref url="/pages/ektIpUpAYjCc24NfwvUK" %}
[The premise object](/api/premises/the-premise-object)
{% endcontent-ref %}

{% content-ref url="/pages/T7EOgsKgAV8KogR5C2yd" %}
[Get a premise](/api/premises/get-a-premise)
{% endcontent-ref %}

{% content-ref url="/pages/WkKI2x7VF4WIGt8xK1lw" %}
[List all premises](/api/premises/list-all-premises)
{% endcontent-ref %}


# The premise object

<table><thead><tr><th width="269.66666666666663">Attribute</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>int</td><td>The unique identified for the premise.</td></tr><tr><td>premise_name</td><td>string</td><td>The display name of the  premise.</td></tr><tr><td>required_variables</td><td>array</td><td>The required variables needed in order to generate the premise. </td></tr><tr><td>premise_type</td><td>string</td><td>The type of premise, either 'email' or 'sentence'.</td></tr><tr><td>profile_name</td><td>string</td><td>The name of the profile this premise is attached to.</td></tr></tbody></table>


# Get a premise

## Get a premise object by ID

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/premises/get/`

Will get the sentence premise object by ID.

#### Query Parameters

| Name                                          | Type | Description                          |
| --------------------------------------------- | ---- | ------------------------------------ |
| premise\_id<mark style="color:red;">\*</mark> | int  | The premise Id you wish to retrieve. |

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Your Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "data": {
        "id": 19,
        "order": 0,
        "is_active": true,
        "required_variables": [
            "person_description"
        ],
        "sentence_premise_name": "Contact",
        "profile_name": "Copyfactory"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/premises/get?premise_id=PREMISE-ID/' \
--header 'Authorization: API-KEY'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://app.copyfactory.io/api/v2/premises/get/"

params = (('premise_id', PREMISE-ID),)

headers = {
  'Authorization': 'API-KEY'
}

response = requests.request("GET", url, headers=headers, params=params)

print(response.text)
```

{% endtab %}
{% endtabs %}


# List all premises

## Will fetch a list of profiles.

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/premises/list/`

An array with all profiles. Each entry in the array is a separate profile object.

#### Query Parameters

| Name          | Type   | Description                                                                               |
| ------------- | ------ | ----------------------------------------------------------------------------------------- |
| profile\_id   | String | The profile ID to further filter results.                                                 |
| premise\_type | String | The premise type to further filter results. The options are either "email" or "sentence". |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
	"data": [{
	'id': 502,
	'premise_name': 'Subject line generator',
	'required_variables': ['client_name', 'how_client_helps'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 529,
	'premise_name': 'Short follow up email',
	'required_variables': ['client_name', 'client_value_proposition', 'how_client_helps', 'product_name'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 530,
	'premise_name': 'A relevant question',
	'required_variables': ['client_value_proposition'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 531,
	'premise_name': 'Section: Value section',
	'required_variables': ['client_name', 'client_value_proposition', 'how_client_helps'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 543,
	'premise_name': 'Section: A relevant question',
	'required_variables': ['client_value_proposition'],
	'profile_name': 'APP',
	'premise_type': 'email'
}]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/premises/list/' \
--header 'Authorization: API-KEY'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://app.copyfactory.io/api/v2/premises/list/"

headers = {
  'Authorization': 'API-KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)

```

{% endtab %}
{% endtabs %}


# Generations


# The generations object

| Attribute  | Type   | Description                                    |
| ---------- | ------ | ---------------------------------------------- |
| content    | string | The generated sentence.                        |
| status     | string | Whether the generation was a success or error. |
| meta\_data | object | Related objects to the generations.            |


# Generate text

To generate text you need a [premise ID](/api/premises) and a dictionary containing **keys** that are the the **required fields** for the premise fields and **values** that contain the actual **data**.&#x20;

Here is a basic example for a **sentence** premise where the required datapoints would have been \[' first\_name'*, '*&#x70;erson\_description'].

```
{
	"first_name": "Mark",
	"person_description": "This is my description of someone..."
}
```

If you do not know the required fields for your premise ID use the [get premise endpoint](/api/premises/get-a-premise).

{% hint style="warning" %}
If you receive an empty sentence back this is likely due to an error in your variables. Make sure to check the required fields and try again. All generations will contain meta data on the request.
{% endhint %}

## Generate text for personalizing contacts or for generating entire emails.

<mark style="color:green;">`POST`</mark> `https://app.copyfactory.io/api/v2/generate/`

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Your Copyfactory API key |

#### Request Body

| Name                                          | Type   | Description                                                                                                  |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------ |
| premise\_id<mark style="color:red;">\*</mark> | int    | The ID of the sentence premise you wish to use.                                                              |
| variables<mark style="color:red;">\*</mark>   | object | A dictionary with keys containing the required data fields and values which contain the actual contact data. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
	"status": "success",
	"content": "This is the generated sentence based on the prospect data.",
	"meta_data": {
		"sentence_premise": {
			"id": 20,
			"order": 1,
			"is_active": False,
			"required_variables": ["first_name", "company_description"],
			"sentence_premise_name": "Company - Edited",
			"profile_name": "Copyfactory"
		},
		"variables": {
			"first_name": "Mark",
			"company_description": "This is my company description"
		}
	}
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request POST 'https://app.copyfactory.io/api/v2/generate/' \
--header 'Authorization: API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
            "premise_id": PREMISE_ID,
            "variables": {"field_name":"field data"}
}'
```

{% endtab %}

{% tab title="Python" %}

```
import requests
import json

url = "https://app.copyfactory.io/api/v2/generate/"

payload = json.dumps({
  "premise_id": PREMISE_ID,
  "variables": {
    "field_name": "field data"
  }
})

headers = {
  'Authorization': 'API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}


# How to generate text

This article explains how to start generating personalized sentences for your contacts.

In order to generate text using the API today you will need two pieces of information:

1. &#x20;The sentence premise ID
2. A dictionary of variables that contain contact data if you are generating a sentence or the inputs if you are generating an email.

The example below will illustrate the process for generating a **sentence premise** however the process is the same for email generation.

{% hint style="info" %}
Premises can only be created in your dashboard.
{% endhint %}

Let's start by grabbing our sentence ID.

You can filter for sentence premise IDs by using the ['list all premises'](/api/premises/list-all-premises) or '[get premise' endpoints](/api/premises/get-a-premise)'. This is what the object returned will look like.

```
# Sentence premise object
{
    "data": {
        "id": 19,
        "premise_name": "Contact",
        "required_variables": [
            "person_description", "first_name"
        ],
        "profile_name": "Copyfactory"
        "premise_type": "sentence"
    }
}
```

The 'required variables' key contains an array of fields that need data for this sentence premise to generate.

```
"required_variables": ["person_description", "first_name"],
```

In the example above we would therefore need to create a dictionary with the keys 'person\_descriptio&#x6E;*'* and *'*&#x66;irst\_name' where the values are the contact data inputs.

```
{
	"first_name": "Mark",
	"person_description": "This is my description of someone..."
}
```

Once we have these two pieces of information the last step is to make a POST request to the generate sentence endpoint.

An example in python could look like this:

```
import requests
import json

url = "https://app.copyfactory.io/api/v2/generate/"

payload = json.dumps({
  "premise_id": 19, # taken from sentence premise ID above
  "variables": {
    "first_name": "Mark",
    "person_description":"This is my description of someone..."
  }
})

headers = {
  'Authorization': 'API-KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

{% hint style="info" %}
If you get an error try looking at the meta data to see the related objects.
{% endhint %}

And you are done!

Consult the text generation object by going to the link below.

{% content-ref url="/pages/Z5B2SJ1ac6bwDrxqa1ir" %}
[Generate text](/api/generations/generate-text)
{% endcontent-ref %}


