Here's an example of creating a task and retrieving back some of it's fields:
POST /data/createAndRetrieve
{ entity: {id: "/task", name: "taskName"}, fields: ["Name", "CreatedBy"] }
As you can see above, the id field contains only the type name.
The query parameter of countQuery should be another Query. Usually you will pass here an entityQuery.
The format of the entityQuery is the same one you are using in the /data/entityQuery call but since you need to somehow "hint" the system that this is an entityQuery, you should add a _type field to the query.
So if, for example, you are querying all tasks in the system where you are the manager:
POST /data/entityQuery
{ typeName: "task", where: {leftExpression: {fieldName: 'Manager'}, operator: 'Equal', rightExpression: {value: '/User/XX-YY0ZZ'}} }
you would count that by doing this:
POST /data/countQuery
{query: {_type: "entityQuery", typeName: "task", where: {leftExpression: {fieldName: 'Manager'}, operator: 'Equal', rightExpression: {value: '/User/XX-YY0ZZ'}}}}
hope this helps, and let me know if you have additional questions!