Skip to main content

Listings

In Directify, listings are the items that appear in your directory. These can be tools, services, products, or any other items you want to showcase. The API endpoints use “projects” in the URL, but they refer to listings in your directory.

Get Directory Listings

Retrieve all listings for a specific directory with pagination.
GET /api/directories/{directory_id}/projects
Parameters:
  • directory_id (integer, required): The ID of the directory
  • page (integer, optional): Page number for pagination (default: 1)
Response:
{
  "data": [
    {
      "id": 1,
      "name": "React.js",
      "slug": "react-js",
      "description": "A JavaScript library for building user interfaces",
      "image_url": "https://example.com/images/react.jpg",
      "logo_url": "https://example.com/logos/react.png",
      "url": "https://reactjs.org",
      "categories": [
        {
          "id": 1,
          "title": "Frontend",
          "parent_title": "Web Development"
        }
      ],
      "tags": [
        {
          "id": 1,
          "title": "Open Source",
          "slug": "open-source",
          "color": "#3B82F6",
          "text_color": "#FFFFFF",
          "is_active": true
        }
      ],
      "listing_url": "https://your-directify-domain.com/app/1/projects/1/edit",
      "is_active": true,
      "is_featured": false,
      "created_at": "2024-01-15T10:30:00.000000Z",
      "updated_at": "2024-01-15T10:30:00.000000Z",
      "pricing": "$0 - $100/month",
      "job_type": "Full-time"
    }
  ],
  "links": {
    "first": "https://your-directify-domain.com/api/directories/1/projects?page=1",
    "last": "https://your-directify-domain.com/api/directories/1/projects?page=5",
    "prev": null,
    "next": "https://your-directify-domain.com/api/directories/1/projects?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 5,
    "per_page": 100,
    "to": 100,
    "total": 450
  }
}

Get Single Listing

Retrieve a specific listing by ID.
GET /api/directories/{directory_id}/projects/{project_id}
Parameters:
  • directory_id (integer, required): The ID of the directory
  • project_id (integer, required): The ID of the listing
Response:
{
  "data": {
    "id": 1,
    "name": "React.js",
    "slug": "react-js",
    "description": "A JavaScript library for building user interfaces",
    "image_url": "https://example.com/images/react.jpg",
    "logo_url": "https://example.com/logos/react.png",
    "url": "https://reactjs.org",
    "categories": [
      {
        "id": 1,
        "title": "Frontend",
        "parent_title": "Web Development"
      }
    ],
    "tags": [
      {
        "id": 1,
        "title": "Open Source",
        "slug": "open-source",
        "color": "#3B82F6",
        "text_color": "#FFFFFF",
        "is_active": true
      }
    ],
    "listing_url": "https://your-directify-domain.com/app/1/projects/1/edit",
    "is_active": true,
    "is_featured": false,
    "created_at": "2024-01-15T10:30:00.000000Z",
    "updated_at": "2024-01-15T10:30:00.000000Z",
    "pricing": "$0 - $100/month",
    "job_type": "Full-time"
  }
}

Check Listing Exists

Check if a listing with a specific URL already exists in the directory.
POST /api/directories/{directory_id}/projects/exists
Parameters:
  • directory_id (integer, required): The ID of the directory
Request Body:
{
  "url": "https://example.com"
}
Response (Listing exists):
{
  "message": "Listing already exists in this directory"
}
Response (Listing doesn’t exist):
{
  "message": "Listing does not exist in this directory"
}

Create Listing

Create a new listing in the directory.
POST /api/directories/{directory_id}/projects
Parameters:
  • directory_id (integer, required): The ID of the directory
Request Body:
{
  "url": "https://example.com",
  "name": "Example Tool",
  "description": "A great tool for developers",
  "category_id": 1,
  "categories": [1, 2],
  "tags": [1, 3],
  "pricing": "Free",
  "job_type": "Full-time",
  "is_active": true,
  "is_featured": false
}
Response:
{
  "data": {
    "id": 123,
    "name": "Example Tool",
    "slug": "example-tool",
    "description": "A great tool for developers",
    "image_url": null,
    "logo_url": null,
    "url": "https://example.com",
    "categories": [
      {
        "id": 1,
        "title": "Web Development",
        "parent_title": null
      },
      {
        "id": 2,
        "title": "Frontend",
        "parent_title": "Web Development"
      }
    ],
    "tags": [
      {
        "id": 1,
        "title": "Open Source",
        "slug": "open-source",
        "color": "#3B82F6",
        "text_color": "#FFFFFF",
        "is_active": true
      },
      {
        "id": 3,
        "title": "Free Tier",
        "slug": "free-tier",
        "color": "#10B981",
        "text_color": "#FFFFFF",
        "is_active": true
      }
    ],
    "listing_url": "https://your-directify-domain.com/app/1/projects/123/edit",
    "is_active": true,
    "is_featured": false,
    "created_at": "2024-01-15T10:30:00.000000Z",
    "updated_at": "2024-01-15T10:30:00.000000Z",
    "pricing": "Free",
    "job_type": "Full-time"
  }
}

Bulk Create Listings

Create multiple listings in a single request. Up to 100 listings can be created at once. Each listing is processed independently, so if one fails, the others will still be created.
POST /api/directories/{directory_id}/projects/bulk
Parameters:
  • directory_id (integer, required): The ID of the directory
Request Body:
{
  "listings": [
    {
      "name": "Listing 1",
      "description": "Description for listing 1",
      "url": "https://example1.com",
      "categories": [1, 2],
      "tags": [1],
      "is_active": true
    },
    {
      "name": "Listing 2",
      "description": "Description for listing 2",
      "category_id": 3,
      "is_featured": true
    },
    {
      "name": "Listing 3",
      "description": "Description for listing 3",
      "url": "https://example3.com",
      "email": "contact@example3.com",
      "phone_number": "+1234567890",
      "address": "123 Main St"
    }
  ]
}
Available fields per listing:
FieldTypeDescription
namestring, requiredThe listing name
descriptionstringShort description
contentstringFull content/body
urlstringWebsite URL (used for duplicate detection)
emailstringContact email
phone_numberstringPhone number
addressstringPhysical address
category_idintegerSingle category ID
categoriesarrayArray of category IDs
tagsarrayArray of tag IDs
is_activebooleanPublished status (default: true)
is_featuredbooleanFeatured flag
is_no_followbooleanNoFollow flag
logo_urlstringLogo image URL
image_urlstringCover image URL
video_urlstringVideo URL
social_linksobjectSocial media links
Custom field values can also be passed by using the custom field name as the key (e.g., "pricing": "Free", "founded_year": "2020").
When a url is provided, the API uses it for duplicate detection. If a listing with the same URL already exists in the directory, it will be returned as-is instead of creating a duplicate.
Response (201 Created):
{
  "data": [
    {
      "id": 123,
      "name": "Listing 1",
      "slug": "listing-1",
      "description": "Description for listing 1",
      "url": "https://example1.com",
      "is_active": true,
      "is_featured": false,
      "categories": [
        { "id": 1, "title": "Category A", "parent_title": null }
      ],
      "tags": [
        { "id": 1, "title": "Tag 1", "slug": "tag-1" }
      ],
      "created_at": "2024-01-15T10:30:00.000000Z",
      "updated_at": "2024-01-15T10:30:00.000000Z"
    },
    {
      "id": 124,
      "name": "Listing 2",
      "slug": "listing-2",
      "description": "Description for listing 2",
      "is_active": true,
      "is_featured": true,
      "categories": [
        { "id": 3, "title": "Category C", "parent_title": null }
      ],
      "created_at": "2024-01-15T10:30:00.000000Z",
      "updated_at": "2024-01-15T10:30:00.000000Z"
    }
  ],
  "errors": [],
  "total_created": 2,
  "total_errors": 0
}
Response with partial errors:
{
  "data": [
    {
      "id": 123,
      "name": "Listing 1",
      "slug": "listing-1"
    }
  ],
  "errors": [
    {
      "index": 1,
      "name": "Listing 2",
      "error": "Error description"
    }
  ],
  "total_created": 1,
  "total_errors": 1
}

Update Listing

Update an existing listing.
PUT /api/directories/{directory_id}/projects/{project_id}
Parameters:
  • directory_id (integer, required): The ID of the directory
  • project_id (integer, required): The ID of the listing
Request Body:
{
  "url": "https://example.com",
  "name": "Updated Example Tool",
  "description": "An updated description for the tool",
  "categories": [1],
  "tags": [1],
  "pricing": "Free - $50/month",
  "job_type": "Part-time",
  "is_active": true,
  "is_featured": true
}
Response:
{
  "data": {
    "id": 123,
    "name": "Updated Example Tool",
    "slug": "updated-example-tool",
    "description": "An updated description for the tool",
    "image_url": "https://example.com/images/updated.jpg",
    "logo_url": "https://example.com/logos/updated.png",
    "url": "https://example.com",
    "categories": [
      {
        "id": 1,
        "title": "Web Development",
        "parent_title": null
      }
    ],
    "tags": [
      {
        "id": 1,
        "title": "Open Source",
        "slug": "open-source",
        "color": "#3B82F6",
        "text_color": "#FFFFFF",
        "is_active": true
      }
    ],
    "listing_url": "https://your-directify-domain.com/app/1/projects/123/edit",
    "is_active": true,
    "is_featured": true,
    "created_at": "2024-01-15T10:30:00.000000Z",
    "updated_at": "2024-01-15T11:45:00.000000Z",
    "pricing": "Free - $50/month",
    "job_type": "Part-time"
  }
}

Delete Listing

Delete a listing from the directory.
DELETE /api/directories/{directory_id}/projects/{project_id}
Parameters:
  • directory_id (integer, required): The ID of the directory
  • project_id (integer, required): The ID of the listing
Response:
{
  "message": "Project deleted successfully"
}