# Get All Single Sends

## API Overview

A Single Send is a one-time, non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery.

Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates.

The Single Sends API allows you to create, retrieve, update, delete, schedule, and deliver your Single Sends. There are also endpoints for searching and statistics to help you maintain and alter your Single Sends as you learn more and further develop your campaigns.

The Single Sends API changed on **May 6, 2020**. Please check the SendGrid Knowledge Center for updates and instructions here: [https://sendgrid.com/docs/for-developers/sending-email/single-sends-2020-update/](/docs/sendgrid/for-developers/sending-email/single-sends-2020-update/)

## Operation overview

```json
{"path":"https://api.sendgrid.com/v3/marketing/singlesends","method":"get","servers":[{"url":"https://api.sendgrid.com","description":"The Twilio SendGrid v3 API"}]}
```

**This endpoint allows you to retrieve all your Single Sends.**

Returns all of your Single Sends with condensed details about each, including the Single Sends' IDs. For more details about an individual Single Send, pass the Single Send's ID to the `/marketing/singlesends/{id}` endpoint.

## Operation details

### Authentication

API Key

### Headers

```json
[{"in":"header","name":"Authorization","required":true,"default":"Bearer <<YOUR_API_KEY_HERE>>","schema":{"type":"string"}}]
```

### Query string

```json
[{"name":"page_size","in":"query","schema":{"type":"integer"}},{"name":"page_token","in":"query","schema":{"type":"string"}}]
```

### Responses

```json
[{"responseCode":"200","schema":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"title":"singlesend_response_short","type":"object","required":["id","name","abtest","status","categories","is_abtest","updated_at","created_at"],"refName":"SinglesendResponseShort","modelName":"SinglesendResponseShort","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"name of the Single Send"},"abtest":{"title":"abTest_summary","required":["type","winner_criteria","test_percentage","duration","winning_template_id","winner_selected_at","expiration_date"],"nullable":true,"type":"object","refName":"AbTestSummary","modelName":"AbTestSummary","properties":{"type":{"type":"string","description":"What differs between the A/B tests","enum":["subject","content"],"refName":"Type","modelName":"Type"},"winner_criteria":{"type":"string","description":"How the winner will be decided","enum":["open","click","manual"],"refName":"WinnerCriteria","modelName":"WinnerCriteria"},"test_percentage":{"type":"integer","description":"What percentage of your recipient will be included in your A/B testing"},"duration":{"type":"string","description":"How long the A/B Testing will last"},"winning_template_id":{"type":"string","description":"Winner of the A/B Test"},"winner_selected_at":{"description":"When the winner was selected","nullable":true,"type":"string"},"expiration_date":{"description":"Last day to select an A/B Test Winner","nullable":true,"type":"string"}}},"status":{"type":"string","description":"current status of the Single Send","enum":["draft","scheduled","triggered"],"refName":"Status3","modelName":"Status3"},"categories":{"type":"array","uniqueItems":true,"maxItems":10,"description":"categories to associate with this Single Send","items":{"type":"string"}},"send_at":{"type":"string","format":"date-time","description":"The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](/docs/sendgrid/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](/docs/sendgrid/ui/sending-email/how-to-send-email-with-marketing-campaigns/)."},"is_abtest":{"type":"boolean","description":"true if the Single Send's AB Test functionality has been toggled on"},"updated_at":{"type":"string","description":"the ISO 8601 time at which the Single Send was last updated","format":"date-time"},"created_at":{"type":"string","description":"the ISO 8601 time at which the Single Send was created","format":"date-time"}}}},"_metadata":{"title":"_metadata","type":"object","refName":"Metadata","modelName":"Metadata","properties":{"prev":{"type":"string","format":"uri"},"self":{"type":"string","format":"uri"},"next":{"type":"string","format":"uri"},"count":{"type":"integer","minimum":0}}}}}}}}},{"responseCode":"500","schema":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"},"error_id":{"type":"string"}}}}}}}}}}]
```

Get All Single Sends

```js
const client = require("@sendgrid/client");
client.setApiKey(process.env.SENDGRID_API_KEY);

const request = {
  url: `/v3/marketing/singlesends`,
  method: "GET",
};

client
  .request(request)
  .then(([response, body]) => {
    console.log(response.statusCode);
    console.log(response.body);
  })
  .catch((error) => {
    console.error(error);
  });
```

```python
import os
from sendgrid import SendGridAPIClient


sg = SendGridAPIClient(os.environ.get("SENDGRID_API_KEY"))


response = sg.client.marketing.singlesends.get()

print(response.status_code)
print(response.body)
print(response.headers)
```

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SendGrid;

public class Program {
    public static async Task Main() {
        string apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY");
        var client = new SendGridClient(apiKey);

        var response = await client.RequestAsync(
            method: SendGridClient.Method.GET, urlPath: "marketing/singlesends");

        Console.WriteLine(response.StatusCode);
        Console.WriteLine(response.Body.ReadAsStringAsync().Result);
        Console.WriteLine(response.Headers.ToString());
    }
}
```

```java
import com.sendgrid.*;
import java.io.IOException;

public class Example {
    public static void main(String[] args) throws IOException {
        try {
            SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
            Request request = new Request();
            request.setMethod(Method.GET);
            request.setEndpoint("/marketing/singlesends");
            Response response = sg.api(request);
            System.out.println(response.getStatusCode());
            System.out.println(response.getBody());
            System.out.println(response.getHeaders());
        } catch (IOException ex) {
            throw ex;
        }
    }
}
```

```go
package main

import (
	"fmt"
	"github.com/sendgrid/sendgrid-go"
	"os"
)

func main() {
	apiKey := os.Getenv("SENDGRID_API_KEY")
	host := "https://api.sendgrid.com"
	request := sendgrid.GetRequest(apiKey, "/v3/marketing/singlesends", host)
	request.Method = "GET"
	response, err := sendgrid.API(request)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(response.StatusCode)
		fmt.Println(response.Body)
		fmt.Println(response.Headers)
	}
}
```

```php
<?php
// Uncomment the next line if you're using a dependency loader (such as Composer) (recommended)
// require 'vendor/autoload.php';

// Uncomment next line if you're not using a dependency loader (such as Composer)
// require_once '<PATH TO>/sendgrid-php.php';

$apiKey = getenv("SENDGRID_API_KEY");
$sg = new \SendGrid($apiKey);

try {
    $response = $sg->client
        ->marketing()
        ->singlesends()
        ->get();
    print $response->statusCode() . "\n";
    print_r($response->headers());
    print $response->body() . "\n";
} catch (Exception $ex) {
    echo "Caught exception: " . $ex->getMessage();
}
```

```ruby
require 'sendgrid-ruby'
include SendGrid

sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])

response = sg.client.marketing.singlesends.get()
puts response.status_code
puts response.headers
puts response.body
```

```bash
curl -X GET "https://api.sendgrid.com/v3/marketing/singlesends" \
--header "Authorization: Bearer $SENDGRID_API_KEY"
```
